3v4l.org

run code in 300+ PHP versions simultaneously
<?php // composer require delboy1978uk/form use Del\Form\AbstractForm; use Del\Form\Field\Text\EmailAddress; use Del\Form\Field\Text; class MemberForm extends AbstractForm { public function init() { $name = new Text('name'); $email = new EmailAddress('email'); $this->addField($email); // Put in member array field s here } } $form = new MemberForm(); $form->populate($postData); if($form->isValid()) { $data = $form->getValues(); // Filtered data! Valid input! // Do yo thang! }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/86hf7
function name:  (null)
number of ops:  14
compiled vars:  !0 = $form, !1 = $postData, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'memberform', 'del%5Cform%5Cabstractform'
   20     1        NEW                                              $3      'MemberForm'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   21     4        INIT_METHOD_CALL                                         !0, 'populate'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
   23     7        INIT_METHOD_CALL                                         !0, 'isValid'
          8        DO_FCALL                                      0  $7      
          9      > JMPZ                                                     $7, ->13
   24    10    >   INIT_METHOD_CALL                                         !0, 'getValues'
         11        DO_FCALL                                      0  $8      
         12        ASSIGN                                                   !2, $8
   26    13    > > RETURN                                                   1

Class MemberForm:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/86hf7
function name:  init
number of ops:  12
compiled vars:  !0 = $name, !1 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'Del%5CForm%5CField%5CText'
          1        SEND_VAL_EX                                              'name'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   14     4        NEW                                              $5      'Del%5CForm%5CField%5CText%5CEmailAddress'
          5        SEND_VAL_EX                                              'email'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   15     8        INIT_METHOD_CALL                                         'addField'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
   17    11      > RETURN                                                   null

End of function init

End of class MemberForm.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.55 ms | 1395 KiB | 13 Q