title: Fatal error: Out of memory (allocated 1872756736) (tried to allocate 262144 bytes)
body: <p>This is my Form</p>
  <pre><code>    &lt;?php
  
  namespace Admin\Form;
  use Admin\Filter\ArticleAddInputFilter;
  use Doctrine\Persistence\ObjectManager;
  use Laminas\Form\Element\Checkbox;
  use Laminas\Form\Element\Submit;
  use Laminas\Form\Element\Text;
  use Laminas\Form\Element\Textarea;
  use Laminas\Form\Form;
  use DoctrineModule;
  
  
  class ArticleAddForm extends Form
  {
  
      protected $objectManager;
  
      public function setObjectManager(ObjectManager $objectManager): void
      {
          $this-&gt;objectManager = $objectManager;
      }
  
      public function getObjectManager()
      {
          return $this-&gt;getObjectManager();
      }
      public function __construct(ObjectManager $objectManager)
      {
          parent::__construct('arrayAddForum');
          $this-&gt;setObjectManager($objectManager);
          $this-&gt;createElements();
      }
      public function createElements()
      {
          $this-&gt;setAttribute('method', 'POST');
          $this-&gt;setAttribute('class', 'bs-example form-horizontal');
  
          $this-&gt;setInputFilter(new ArticleAddInputFilter());
  
          $this-&gt;add([
              'type' =&gt; DoctrineModule\Form\Element\ObjectSelect::class,
              'name' =&gt; 'category',
              'options' =&gt; [
                  'label' =&gt; 'Категория',
                  'empty_option' =&gt; 'Выберите категорию...',
                  'object_manager' =&gt; $this-&gt;getObjectManager(),
                  'target_class' =&gt; 'Blog\Entity\Category',
                  'property' =&gt; 'categoryName',
              ],
              'attributes' =&gt; [
               'class' =&gt; 'form-control',
               'required' =&gt; true,
              ]
          ]);
          $this-&gt;add([
              'name' =&gt; 'title',
              'type' =&gt; Text::class,
              'options' =&gt; [
                  'min' =&gt; 3,
                  'max' =&gt; 100,
                  'label' =&gt; 'Заголовок'
              ],
              'attributes' =&gt; [
                  'class' =&gt; 'form-control',
                  'required' =&gt; true
              ]
          ]);
          $this-&gt;add([
              'name' =&gt; 'shortArticle',
              'type' =&gt; Textarea::class,
              'options' =&gt; [
                  'label' =&gt; 'Начало статьти',
              ],
              'attributes' =&gt; [
                  'class' =&gt; 'form-controller ckeditor'
              ],
          ]);
          $this-&gt;add([
              'name' =&gt; 'article',
              'type' =&gt; Textarea::class,
              'options' =&gt; [
                  'label' =&gt; 'Статья',
              ],
          ]);
          $this-&gt;add([
              'name' =&gt; 'isPublic',
              'type' =&gt; Checkbox::class,
              'options' =&gt; [
                  'label' =&gt; 'Опубликовать',
                  'use_hidden_Element' =&gt; true,
                  'checked_value' =&gt; 1,
                  'unchecked_value' =&gt; 0
              ],
          ]);
          $this-&gt;add([
              'name' =&gt; 'submit',
              'type' =&gt; Submit::class,
              'attributes' =&gt; [
                  'value' =&gt; 'Сохранить',
                  'id' =&gt; 'btn_submit',
                  'class' =&gt; 'btn btn-primary'
              ]
          ]);
      }
  }
  </code></pre>
  <p>This is my controller :</p>
  <pre><code>    public function addAction()
  {
      $em = $this-&gt;entityManager;
  
      $form = new ArticleAddForm($em);
      $request = $this-&gt;getRequest();
      if($request-&gt;isPost())
      {
          $article = new Article();
          $form-&gt;setHydrator(new DoctrineHydrator($em, '\Article'));
          $form-&gt;bind($article);
          $form-&gt;setData($request-&gt;getPost());
          if($form-&gt;isValid())
          {
              $em-&gt;persist($article);
              $em-&gt;flush();
          }
      }else {
          return ['form' =&gt; $form];
      }
      return $this-&gt;redirect()-&gt;toRoute('admin/article');
  }
  </code></pre>
  <p>On exit i am have this error Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 262144 bytes) in .
  If you help me, I will be very kind and grateful. I 've been working on this error for a very long time , I 've already tried everything , nothing works . Maybe I started an infinite loop somewhere , but it 's not . I 've already tried changing the configuration .htaccess and php.ini, did not work</p>