3v4l.org

run code in 300+ PHP versions simultaneously
<?php class R { public function __toString() { return (string)mt_rand(); } } $a = new R(); var_dump($a !== $a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XTa50
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'r'
   12     1        NEW                                              $1      'R'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   14     4        INIT_FCALL                                               'var_dump'
          5        IS_NOT_IDENTICAL                                 ~4      !0, !0
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

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

End of function __tostring

End of class R.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.21 ms | 1395 KiB | 17 Q