3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface Foo { public function bar(?string $baz = null); } class Fooo implements Foo { public function bar(string $baz = null) { return $baz; } } class Barz extends Fooo { public function bar(?string $baz = null) { return var_export($baz, true); } } $foo = new Fooo(); $bar = new Barz(); var_dump($foo->bar(), $bar->bar());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CiQth
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                                'fooo'
   16     1        DECLARE_CLASS                                                'barz', 'fooo'
   24     2        NEW                                                  $2      'Fooo'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $2
   25     5        NEW                                                  $5      'Barz'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $5
   26     8        INIT_FCALL                                                   'var_dump'
          9        INIT_METHOD_CALL                                             !0, 'bar'
         10        DO_FCALL                                          0  $8      
         11        SEND_VAR                                                     $8
         12        INIT_METHOD_CALL                                             !1, 'bar'
         13        DO_FCALL                                          0  $9      
         14        SEND_VAR                                                     $9
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CiQth
function name:  bar
number of ops:  2
compiled vars:  !0 = $baz
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                            !0      null
          1      > RETURN                                                       null

End of function bar

End of class Foo.

Class Fooo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CiQth
function name:  bar
number of ops:  3
compiled vars:  !0 = $baz
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV_INIT                                            !0      null
   12     1      > RETURN                                                       !0
   13     2*     > RETURN                                                       null

End of function bar

End of class Fooo.

Class Barz:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CiQth
function name:  bar
number of ops:  7
compiled vars:  !0 = $baz
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV_INIT                                            !0      null
   20     1        INIT_FCALL                                                   'var_export'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     <true>
          4        DO_ICALL                                             $1      
          5      > RETURN                                                       $1
   21     6*     > RETURN                                                       null

End of function bar

End of class Barz.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
151.62 ms | 2061 KiB | 15 Q