3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { function abc() { echo file_get_contents('http://google.com'); $callback = function(){ //Here is the syntax error return 'Hello world!<br>'; }; return $GLOBALS['otherClass']->birds($callback); } } class otherClass { function birds($callback) { return $callback(); } } $GLOBALS['otherClass'] = new otherClass(); $myClass = new myClass(); echo $myClass->abc(); echo $myClass->abc();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDmLs
function name:  (null)
number of ops:  15
compiled vars:  !0 = $myClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $3      'otherClass'
          1        DO_FCALL                                      0          
          2        FETCH_W                      global              $1      'GLOBALS'
          3        ASSIGN_DIM                                               $1, 'otherClass'
          4        OP_DATA                                                  $3
   28     5        NEW                                              $5      'myClass'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $5
   30     8        INIT_METHOD_CALL                                         !0, 'abc'
          9        DO_FCALL                                      0  $8      
         10        ECHO                                                     $8
   31    11        INIT_METHOD_CALL                                         !0, 'abc'
         12        DO_FCALL                                      0  $9      
         13        ECHO                                                     $9
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FrDmLs%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDmLs
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   'Hello+world%21%3Cbr%3E'
   10     1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FrDmLs%3A8%240

Class myClass:
Function abc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDmLs
function name:  abc
number of ops:  13
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'file_get_contents'
          1        SEND_VAL                                                 'http%3A%2F%2Fgoogle.com'
          2        DO_ICALL                                         $1      
          3        ECHO                                                     $1
    8     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FrDmLs%3A8%240'
          5        ASSIGN                                                   !0, ~2
   12     6        FETCH_R                      global              ~4      'GLOBALS'
          7        FETCH_DIM_R                                      ~5      ~4, 'otherClass'
          8        INIT_METHOD_CALL                                         ~5, 'birds'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $6      
         11      > RETURN                                                   $6
   14    12*     > RETURN                                                   null

End of function abc

End of class myClass.

Class otherClass:
Function birds:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDmLs
function name:  birds
number of ops:  5
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   23     4*     > RETURN                                                   null

End of function birds

End of class otherClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151 ms | 1392 KiB | 15 Q