3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class x { function test($z, x $x) { var_dump($x); } } class y extends x { function test($z, $x = null) { parent::test($x, $x); } } (new y)->test(null);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/45tDp
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $0      'y'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'test'
          3        SEND_VAL_EX                                              null
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function test

End of class x.

Class y:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/45tDp
function name:  test
number of ops:  7
compiled vars:  !0 = $z, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   13     2        INIT_STATIC_METHOD_CALL                                  'test'
          3        SEND_VAR_EX                                              !1
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   14     6      > RETURN                                                   null

End of function test

End of class y.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.25 ms | 1400 KiB | 15 Q