3v4l.org

run code in 300+ PHP versions simultaneously
<?php class toStr { private $str; public function __construct( $str ) { $this->str = $str; } public function __toString() { return $this->str; } } $a = new toStr( 'hi' ); var_dump( $a === 'hi' ); var_dump( $a == 'hi' ); var_dump( 'hi' === $a ); var_dump( 'hi' == $a );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6CNqk
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'tostr'
   16     1        NEW                                              $1      'toStr'
          2        SEND_VAL_EX                                              'hi'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   18     5        INIT_FCALL                                               'var_dump'
          6        IS_IDENTICAL                                     ~4      !0, 'hi'
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                                 
   19     9        INIT_FCALL                                               'var_dump'
         10        IS_EQUAL                                         ~6      !0, 'hi'
         11        SEND_VAL                                                 ~6
         12        DO_ICALL                                                 
   20    13        INIT_FCALL                                               'var_dump'
         14        IS_IDENTICAL                                     ~8      !0, 'hi'
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                                 
   21    17        INIT_FCALL                                               'var_dump'
         18        IS_EQUAL                                         ~10     !0, 'hi'
         19        SEND_VAL                                                 ~10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class toStr:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6CNqk
function name:  __construct
number of ops:  4
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'str'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

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

End of function __tostring

End of class toStr.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.09 ms | 1396 KiB | 15 Q