3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface FormStateInterface {} class FormState implements FormStateInterface {} class ConfigFormBase { public function submitForm(array &$form, FormStateInterface $form_state) { print "original"; } } trait ValidatableConfigFormTrait { public function submitForm(array &$form, FormStateInterface $form_state) { print "trait"; } } class MyForm extends ConfigFormBase { use ValidatableConfigFormTrait; } $form = []; (new MyForm())->submitForm($form, new FormState());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7fIUk
function name:  (null)
number of ops:  12
compiled vars:  !0 = $form
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'formstate'
   18     1        DECLARE_CLASS                                            'myform', 'configformbase'
   22     2        ASSIGN                                                   !0, <array>
   23     3        NEW                                              $2      'MyForm'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $2, 'submitForm'
          6        SEND_VAR_EX                                              !0
          7        NEW                                              $4      'FormState'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $4
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class FormStateInterface: [no user functions]
Class FormState: [no user functions]
Class ConfigFormBase:
Function submitform:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7fIUk
function name:  submitForm
number of ops:  4
compiled vars:  !0 = $form, !1 = $form_state
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ECHO                                                     'original'
    9     3      > RETURN                                                   null

End of function submitform

End of class ConfigFormBase.

Class ValidatableConfigFormTrait:
Function submitform:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7fIUk
function name:  submitForm
number of ops:  4
compiled vars:  !0 = $form, !1 = $form_state
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        ECHO                                                     'trait'
   15     3      > RETURN                                                   null

End of function submitform

End of class ValidatableConfigFormTrait.

Class MyForm: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.16 ms | 1449 KiB | 13 Q