3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class Foo { /** * @param int $i * @return void */ public function bar($i) {} public function baz(int $i): void {} } /** * @method string bar(bool $b, object $o) * @method string baz(bool $b, object $o) */ class Woo extends Foo {} $w = new Woo(); $r1 = $w->bar(true, new \stdClass); $r2 = $w->baz(true, new \stdClass); //$r3 = $w->bar(123); //$r4 = $w->baz(123); function test(float $f) {}; test($r1); test($r2); //test($r3); //test($r4);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a45q7
function name:  (null)
number of ops:  24
compiled vars:  !0 = $w, !1 = $r1, !2 = $r2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $3      'Woo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   19     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        SEND_VAL_EX                                              <true>
          5        NEW                                              $6      'stdClass'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $6
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !1, $8
   20    10        INIT_METHOD_CALL                                         !0, 'baz'
         11        SEND_VAL_EX                                              <true>
         12        NEW                                              $10     'stdClass'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $10
         15        DO_FCALL                                      0  $12     
         16        ASSIGN                                                   !2, $12
   25    17        INIT_FCALL                                               'test'
         18        SEND_VAR                                                 !1
         19        DO_FCALL                                      0          
   26    20        INIT_FCALL                                               'test'
         21        SEND_VAR                                                 !2
         22        DO_FCALL                                      0          
   28    23      > RETURN                                                   1

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

End of function test

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

End of function bar

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

End of function baz

End of class Foo.

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

End of function bar

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

End of function baz

End of class Woo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
231.55 ms | 1003 KiB | 15 Q