3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function lorem() { echo __METHOD__, PHP_EOL; return $this; } public function ipsum() { echo __METHOD__, PHP_EOL; return $this; } public function dolor() { echo __METHOD__, PHP_EOL; return [42 => $this]; } } (new Foo())->lorem()->ipsum() ->dolor()[42]->lorem(); $x = (new Foo())->lorem(); ($x)->ipsum(); ($x->ipsum())->dolor(); //( (new Foo())->lorem()->ipsum() )->dolor()[42]->lorem();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d2ViU
function name:  (null)
number of ops:  23
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'lorem'
          3        DO_FCALL                                      0  $3      
          4        INIT_METHOD_CALL                                         $3, 'ipsum'
          5        DO_FCALL                                      0  $4      
          6        INIT_METHOD_CALL                                         $4, 'dolor'
          7        DO_FCALL                                      0  $5      
          8        FETCH_DIM_R                                      ~6      $5, 42
          9        INIT_METHOD_CALL                                         ~6, 'lorem'
         10        DO_FCALL                                      0          
   19    11        NEW                                              $8      'Foo'
         12        DO_FCALL                                      0          
         13        INIT_METHOD_CALL                                         $8, 'lorem'
         14        DO_FCALL                                      0  $10     
         15        ASSIGN                                                   !0, $10
   20    16        INIT_METHOD_CALL                                         !0, 'ipsum'
         17        DO_FCALL                                      0          
   21    18        INIT_METHOD_CALL                                         !0, 'ipsum'
         19        DO_FCALL                                      0  $13     
         20        INIT_METHOD_CALL                                         $13, 'dolor'
         21        DO_FCALL                                      0          
   23    22      > RETURN                                                   1

Class Foo:
Function lorem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d2ViU
function name:  lorem
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'Foo%3A%3Alorem'
          1        ECHO                                                     '%0A'
    5     2        FETCH_THIS                                       ~0      
          3      > RETURN                                                   ~0
    6     4*     > RETURN                                                   null

End of function lorem

Function ipsum:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d2ViU
function name:  ipsum
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                     'Foo%3A%3Aipsum'
          1        ECHO                                                     '%0A'
    9     2        FETCH_THIS                                       ~0      
          3      > RETURN                                                   ~0
   10     4*     > RETURN                                                   null

End of function ipsum

Function dolor:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d2ViU
function name:  dolor
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'Foo%3A%3Adolor'
          1        ECHO                                                     '%0A'
   13     2        FETCH_THIS                                       ~0      
          3        INIT_ARRAY                                       ~1      ~0, 42
          4      > RETURN                                                   ~1
   14     5*     > RETURN                                                   null

End of function dolor

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.97 ms | 1399 KiB | 13 Q