3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pizza { public $toppings = array(); public function __toString() { return 'pizza'; } } $veggie = new Pizza; $veggie->toppings = array('mushrooms', 'olives', 'onions'); $meatie = new Pizza; $meatie->toppings = array('pepperoni', 'sausage'); var_dump($veggie === $meatie); var_dump($veggie === 'pizza'); var_dump($veggie == 'pizza'); var_dump('' . $veggie === 'pizza');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MabDn
function name:  (null)
number of ops:  29
compiled vars:  !0 = $veggie, !1 = $meatie
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'pizza'
   12     1        NEW                                              $2      'Pizza'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   13     4        ASSIGN_OBJ                                               !0, 'toppings'
          5        OP_DATA                                                  <array>
   15     6        NEW                                              $6      'Pizza'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   16     9        ASSIGN_OBJ                                               !1, 'toppings'
         10        OP_DATA                                                  <array>
   18    11        INIT_FCALL                                               'var_dump'
         12        IS_IDENTICAL                                     ~10     !0, !1
         13        SEND_VAL                                                 ~10
         14        DO_ICALL                                                 
   19    15        INIT_FCALL                                               'var_dump'
         16        IS_IDENTICAL                                     ~12     !0, 'pizza'
         17        SEND_VAL                                                 ~12
         18        DO_ICALL                                                 
   20    19        INIT_FCALL                                               'var_dump'
         20        IS_EQUAL                                         ~14     !0, 'pizza'
         21        SEND_VAL                                                 ~14
         22        DO_ICALL                                                 
   21    23        INIT_FCALL                                               'var_dump'
         24        CONCAT                                           ~16     '', !0
         25        IS_IDENTICAL                                     ~17     ~16, 'pizza'
         26        SEND_VAL                                                 ~17
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

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

End of function __tostring

End of class Pizza.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.33 ms | 1388 KiB | 15 Q