3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function someMethod(?string $s = NULL) { print $s; } } class b extends a { public function someMethod(string $s = NULL) { print 'b' . $s; } } $b = new b; $b->someMethod('string');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gas1U
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'someMethod'
          4        SEND_VAL_EX                                              'string'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class a:
Function somemethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gas1U
function name:  someMethod
number of ops:  3
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
    5     1        ECHO                                                     !0
    6     2      > RETURN                                                   null

End of function somemethod

End of class a.

Class b:
Function somemethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gas1U
function name:  someMethod
number of ops:  4
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV_INIT                                        !0      null
   11     1        CONCAT                                           ~1      'b', !0
          2        ECHO                                                     ~1
   12     3      > RETURN                                                   null

End of function somemethod

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.61 ms | 1007 KiB | 13 Q