3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass { public function test(stdClass $thing) { print_r($thing); } } class ChildClass extends ParentClass { public function test($thing = null) { print_r($thing); } } $child = new ChildClass(); $child->test(new stdClass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iPH5g
function name:  (null)
number of ops:  9
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'ChildClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'test'
          4        NEW                                              $4      'stdClass'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $4
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class ParentClass:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iPH5g
function name:  test
number of ops:  5
compiled vars:  !0 = $thing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    8     4      > RETURN                                                   null

End of function test

End of class ParentClass.

Class ChildClass:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iPH5g
function name:  test
number of ops:  5
compiled vars:  !0 = $thing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV_INIT                                        !0      null
   15     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   16     4      > RETURN                                                   null

End of function test

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.13 ms | 1395 KiB | 15 Q