3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Something extends \SplFileObject { public function __toString() { return 'calling __toString'; } } $file = sys_get_temp_dir() . 'foo.php'; touch($file); $something = new Something($file); echo $something; // 'calling __toString' echo (string) $something; // 'test.php' echo $something->__toString(); // 'calling __toString'
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uRene
function name:  (null)
number of ops:  19
compiled vars:  !0 = $file, !1 = $something
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'something', 'splfileobject'
    9     1        INIT_FCALL                                               'sys_get_temp_dir'
          2        DO_ICALL                                         $2      
          3        CONCAT                                           ~3      $2, 'foo.php'
          4        ASSIGN                                                   !0, ~3
   10     5        INIT_FCALL                                               'touch'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   12     8        NEW                                              $6      'Something'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $6
   13    12        ECHO                                                     !1
   14    13        CAST                                          6  ~9      !1
         14        ECHO                                                     ~9
   15    15        INIT_METHOD_CALL                                         !1, '__toString'
         16        DO_FCALL                                      0  $10     
         17        ECHO                                                     $10
         18      > RETURN                                                   1

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

End of function __tostring

End of class Something.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.1 ms | 941 KiB | 18 Q