3v4l.org

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

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

End of function __tostring

End of class Stringable.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.14 ms | 1386 KiB | 15 Q