3v4l.org

run code in 500+ PHP versions simultaneously
<?php class C { public function __toString(): string { global $arr; $arr = null; return "C"; } } $arr = [new C, 42]; implode(", ", $arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DAvOV
function name:  (null)
number of ops:  9
compiled vars:  !0 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'c'
   11     1        NEW                                                  $1      'C'
          2        DO_FCALL                                          0          
          3        INIT_ARRAY                                           ~3      $1
          4        ADD_ARRAY_ELEMENT                                    ~3      42
          5        ASSIGN                                                       !0, ~3
   12     6        FRAMELESS_ICALL_2                implode             ~5      '%2C+', !0
          7        FREE                                                         ~5
          8      > RETURN                                                       1

Class C:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DAvOV
function name:  __toString
number of ops:  5
compiled vars:  !0 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   BIND_GLOBAL                                                  !0, 'arr'
    6     1        ASSIGN                                                       !0, null
    7     2      > RETURN                                                       'C'
    8     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function __tostring

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
135.73 ms | 482 KiB | 9 Q