3v4l.org

run code in 300+ PHP versions simultaneously
<?php const TEST = 1; class Foo { function __toString() { return "1"; } } $foo = new Foo(); var_dump( '1' == TEST, '1' == $foo, '1' == 1, $foo == TEST );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3ttKH
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'TEST', 1
    4     1        DECLARE_CLASS                                            'foo'
   10     2        NEW                                              $1      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   11     5        INIT_FCALL                                               'var_dump'
   12     6        FETCH_CONSTANT                                   ~4      'TEST'
          7        IS_EQUAL                                         ~5      ~4, '1'
          8        SEND_VAL                                                 ~5
   13     9        IS_EQUAL                                         ~6      !0, '1'
         10        SEND_VAL                                                 ~6
   14    11        SEND_VAL                                                 <true>
   15    12        FETCH_CONSTANT                                   ~7      'TEST'
         13        IS_EQUAL                                         ~8      !0, ~7
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   16    16      > RETURN                                                   1

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

End of function __tostring

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.44 ms | 1395 KiB | 15 Q