3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __toString() { return null; } } $array = array(); $a = new A; $array[(string) $a] = $a; $array[(string) $a] = $a; var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vvt5d
function name:  (null)
number of ops:  15
compiled vars:  !0 = $array, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
   10     1        ASSIGN                                                   !0, <array>
   11     2        NEW                                              $3      'A'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   12     5        CAST                                          6  ~6      !1
          6        ASSIGN_DIM                                               !0, ~6
          7        OP_DATA                                                  !1
   13     8        CAST                                          6  ~8      !1
          9        ASSIGN_DIM                                               !0, ~8
         10        OP_DATA                                                  !1
   15    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function __tostring

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.54 ms | 1395 KiB | 15 Q