3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class UString { private $string = null; public function __construct(string $string) { $this->string = $string; } public function __toString() { return $this->string; } } echo strlen(new Ustring('Class with __string method !'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AnZP8
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'ustring'
   20     1        NEW                                              $0      'Ustring'
          2        SEND_VAL_EX                                              'Class+with+__string+method+%21'
          3        DO_FCALL                                      0          
          4        STRLEN                                           ~2      $0
          5        ECHO                                                     ~2
          6      > RETURN                                                   1

Class UString:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AnZP8
function name:  __construct
number of ops:  4
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        ASSIGN_OBJ                                               'string'
          2        OP_DATA                                                  !0
   12     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/AnZP8
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_OBJ_R                                      ~0      'string'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   17     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

End of class UString.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.27 ms | 1385 KiB | 13 Q