3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function foo(?string $text = null) { var_dump($text); } } class B extends A { public function foo(string $text = null) { var_dump($text); } } $a = new A(); $a->foo('Hello'); $b = new B(); $b->foo('Hello');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sBTat
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        SEND_VAL_EX                                              'Hello'
          5        DO_FCALL                                      0          
   22     6        NEW                                              $6      'B'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   23     9        INIT_METHOD_CALL                                         !1, 'foo'
         10        SEND_VAL_EX                                              'Hello'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

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

End of function foo

End of class A.

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

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.37 ms | 1088 KiB | 14 Q