3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Auth { function __construct($foo) { $this->foo = $foo; } function __toString() { return "Basic ".$this->foo; } } $auth = new Auth('1234'); $bar = (string)$auth; echo $bar;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XAJY9
function name:  (null)
number of ops:  9
compiled vars:  !0 = $auth, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'auth'
   17     1        NEW                                              $2      'Auth'
          2        SEND_VAL_EX                                              '1234'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   19     5        CAST                                          6  ~5      !0
          6        ASSIGN                                                   !1, ~5
   21     7        ECHO                                                     !1
          8      > RETURN                                                   1

Class Auth:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XAJY9
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'foo'
          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/XAJY9
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'foo'
          1        CONCAT                                           ~1      'Basic+', ~0
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
   13     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function __tostring

End of class Auth.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.45 ms | 1385 KiB | 13 Q