3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { private $p = 1; public $q = 2; } $x = new x; $y = (array) $x; print_r($y); /* Array ( [Xp] => 1 [q] => 2 ) */ $f = function() {}; print get_class($f); /// Closure var_dump((array) $f); /* Closure array(1) { [0]=> object(Closure)#2 (0) { } } */ ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4FGnj
function name:  (null)
number of ops:  17
compiled vars:  !0 = $x, !1 = $y, !2 = $f
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   NEW                                                  $3      'x'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
    9     3        CAST                                              7  ~6      !0
          4        ASSIGN                                                       !1, ~6
   10     5        INIT_FCALL                                                   'print_r'
          6        SEND_VAR                                                     !1
          7        DO_ICALL                                                     
   20     8        DECLARE_LAMBDA_FUNCTION                              ~9      [0]
          9        ASSIGN                                                       !2, ~9
   21    10        GET_CLASS                                            ~11     !2
         11        ECHO                                                         ~11
   22    12        INIT_FCALL                                                   'var_dump'
         13        CAST                                              7  ~12     !2
         14        SEND_VAL                                                     ~12
         15        DO_ICALL                                                     
   32    16      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4FGnj
function name:  {closure:/in/4FGnj:20}
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E > > RETURN                                                       null

End of Dynamic Function 0

Class X: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
138.34 ms | 1482 KiB | 15 Q