3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public static $x; public function __toString() { self::$x = $this; return __FILE__; } } $a = new test; require_once $a; debug_zval_dump(test::$x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kCShJ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'test'
   10     1        NEW                                              $1      'test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   11     4        INCLUDE_OR_EVAL                                          !0, REQUIRE_ONCE
   12     5        INIT_FCALL                                               'debug_zval_dump'
          6        FETCH_STATIC_PROP_R          unknown             ~5      'x'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class test:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kCShJ
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       ~1      
          1        ASSIGN_STATIC_PROP                                       'x'
          2        OP_DATA                                                  ~1
    7     3      > RETURN                                                   '%2Fin%2FkCShJ'
    8     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function __tostring

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.15 ms | 1395 KiB | 15 Q