3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register('loader'); function loader($className) { echo "loading $className\n"; if ($className == 'B') eval("class B { function __wakeup(){echo 'B::__wakeup';}}"); else if ($className == 'D') eval("class D { function __wakeup(){echo 'D::__wakeup';}}"); else if ($className == 'E') eval("class E extends D { function __wakeup(){echo 'E::__wakeup';}}"); echo "loaded $className: " . class_exists($className, false) . "\n"; return true; } class Wakeup { public $b; public $e; function __construct() { $this->b = new B; $this->e = new E; } } unserialize('O:6:"Wakeup":2:{s:1:"b";O:1:"B":0:{}s:1:"e";O:1:"E":0:{}}');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jbUJ
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'spl_autoload_register'
          1        SEND_VAL                                                 'loader'
          2        DO_ICALL                                                 
   32     3        INIT_FCALL                                               'unserialize'
          4        SEND_VAL                                                 'O%3A6%3A%22Wakeup%22%3A2%3A%7Bs%3A1%3A%22b%22%3BO%3A1%3A%22B%22%3A0%3A%7B%7Ds%3A1%3A%22e%22%3BO%3A1%3A%22E%22%3A0%3A%7B%7D%7D'
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function loader:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/4jbUJ
function name:  loader
number of ops:  28
compiled vars:  !0 = $className
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ROPE_INIT                                     3  ~2      'loading+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
    9     5        IS_EQUAL                                                 !0, 'B'
          6      > JMPZ                                                     ~4, ->9
   10     7    >   INCLUDE_OR_EVAL                                          'class+B+%7B+function+__wakeup%28%29%7Becho+%27B%3A%3A__wakeup%27%3B%7D%7D', EVAL
          8      > JMP                                                      ->16
   11     9    >   IS_EQUAL                                                 !0, 'D'
         10      > JMPZ                                                     ~6, ->13
   12    11    >   INCLUDE_OR_EVAL                                          'class+D+%7B+function+__wakeup%28%29%7Becho+%27D%3A%3A__wakeup%27%3B%7D%7D', EVAL
         12      > JMP                                                      ->16
   13    13    >   IS_EQUAL                                                 !0, 'E'
         14      > JMPZ                                                     ~8, ->16
   14    15    >   INCLUDE_OR_EVAL                                          'class+E+extends+D+%7B+function+__wakeup%28%29%7Becho+%27E%3A%3A__wakeup%27%3B%7D%7D', EVAL
   16    16    >   ROPE_INIT                                     3  ~11     'loaded+'
         17        ROPE_ADD                                      1  ~11     ~11, !0
         18        ROPE_END                                      2  ~10     ~11, '%3A+'
         19        INIT_FCALL                                               'class_exists'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 <false>
         22        DO_ICALL                                         $13     
         23        CONCAT                                           ~14     ~10, $13
         24        CONCAT                                           ~15     ~14, '%0A'
         25        ECHO                                                     ~15
   17    26      > RETURN                                                   <true>
   18    27*     > RETURN                                                   null

End of function loader

Class Wakeup:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jbUJ
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'b'
          3        OP_DATA                                                  $1
   28     4        NEW                                              $4      'E'
          5        DO_FCALL                                      0          
          6        ASSIGN_OBJ                                               'e'
          7        OP_DATA                                                  $4
   29     8      > RETURN                                                   null

End of function __construct

End of class Wakeup.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.25 ms | 1392 KiB | 19 Q