3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { static $i =0; function __toString() { $a = ['', 'a']; $r = $a[$i]; $i++; return $r; } } var_dump('' == $a and 'a' == $a);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/iro4X
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'a'
   12     1        INIT_FCALL                                               'var_dump'
          2        IS_EQUAL                                         ~1      !0, ''
          3      > JMPZ_EX                                          ~1      ~1, ->6
          4    >   IS_EQUAL                                         ~2      !0, 'a'
          5        BOOL                                             ~1      ~2
          6    >   SEND_VAL                                                 ~1
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class a:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iro4X
function name:  __toString
number of ops:  8
compiled vars:  !0 = $a, !1 = $r, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
    7     1        FETCH_DIM_R                                      ~4      !0, !2
          2        ASSIGN                                                   !1, ~4
    8     3        PRE_INC                                                  !2
    9     4        VERIFY_RETURN_TYPE                                       !1
          5      > RETURN                                                   !1
   10     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function __tostring

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.7 ms | 1395 KiB | 15 Q