3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Group { private $number = 20; public function __toString() { return "$this->number"; } } $number = new Group(); echo ++ $number, PHP_EOL; $number = 20; echo ++ $number, PHP_EOL; // var_dump(new Group() === "20"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mFPo2
function name:  (null)
number of ops:  12
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'group'
   10     1        NEW                                              $1      'Group'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   11     4        PRE_INC                                          ~4      !0
          5        ECHO                                                     ~4
          6        ECHO                                                     '%0A'
   13     7        ASSIGN                                                   !0, 20
   14     8        PRE_INC                                          ~6      !0
          9        ECHO                                                     ~6
         10        ECHO                                                     '%0A'
   18    11      > RETURN                                                   1

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

End of function __tostring

End of class Group.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.14 ms | 1393 KiB | 13 Q