3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Too { static function bar() { $a = function () { var_dump(__CLASS__); }; $a(); $a = function () { var_dump(get_class()); }; $a(); if (isset($this)) { $a = function () { var_dump(get_class($this)); }; $a(); } } } class Foo { use Too; } $f = new Foo; echo "Between\n"; $f->bar(); echo "Between\n"; $f::bar(); echo "Between\n"; Foo::bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWK74
function name:  (null)
number of ops:  15
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   DECLARE_CLASS                                            'foo'
   23     1        NEW                                              $1      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   24     4        ECHO                                                     'Between%0A'
   25     5        INIT_METHOD_CALL                                         !0, 'bar'
          6        DO_FCALL                                      0          
   26     7        ECHO                                                     'Between%0A'
   27     8        FETCH_CLASS                                   0  $5      !0
          9        INIT_STATIC_METHOD_CALL                                  $5, 'bar'
         10        DO_FCALL                                      0          
   28    11        ECHO                                                     'Between%0A'
   29    12        INIT_STATIC_METHOD_CALL                                  'Foo', 'bar'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FRWK74%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWK74
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CLASS_NAME                                 ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    7     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRWK74%3A5%240

Function %00%7Bclosure%7D%2Fin%2FRWK74%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWK74
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        GET_CLASS                                        ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   11     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRWK74%3A9%241

Function %00%7Bclosure%7D%2Fin%2FRWK74%3A14%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWK74
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        GET_CLASS                                        ~1      ~0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   16     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRWK74%3A14%242

Class Too:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/RWK74
function name:  bar
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRWK74%3A5%240'
          1        ASSIGN                                                   !0, ~1
    8     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
    9     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRWK74%3A9%241'
          5        ASSIGN                                                   !0, ~4
   12     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0          
   13     8        ISSET_ISEMPTY_THIS                               ~7      
          9      > JMPZ                                                     ~7, ->14
   14    10    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRWK74%3A14%242'
         11        ASSIGN                                                   !0, ~8
   17    12        INIT_DYNAMIC_CALL                                        !0
         13        DO_FCALL                                      0          
   19    14    > > RETURN                                                   null

End of function bar

End of class Too.

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.61 ms | 1400 KiB | 15 Q