3v4l.org

run code in 300+ PHP versions simultaneously
<?php function creator($var) { return new class($var) { private static $var; function __construct($var) { static::$var = $var; } function __debugInfo() { return [ "\0*\0var" => static::$var, ]; } }; } $a = creator('A'); $b = creator('B'); var_dump($a, $b, $a === $b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vLjTI
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'creator'
          1        SEND_VAL                                                 'A'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
   22     4        INIT_FCALL                                               'creator'
          5        SEND_VAL                                                 'B'
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                                   !1, $4
   23     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        IS_IDENTICAL                                     ~6      !0, !1
         12        SEND_VAL                                                 ~6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function creator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vLjTI
function name:  creator
number of ops:  7
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        DECLARE_ANON_CLASS                               <undef> 
          2        NEW                                              $2      $1
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   $2
   19     6*     > RETURN                                                   null

End of function creator

Class class@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vLjTI
function name:  __construct
number of ops:  4
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_STATIC_PROP                                       'var'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function __debuginfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vLjTI
function name:  __debugInfo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'var'
          1        INIT_ARRAY                                       ~1      ~0, '%00%2A%00var'
          2      > RETURN                                                   ~1
   17     3*     > RETURN                                                   null

End of function __debuginfo

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.54 ms | 1403 KiB | 17 Q