3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SiteId { protected $id; public function __construct($id) { $this->id = $id; } public function getId() { return $this->id; } } $siteId = new SiteId("1"); echo "Is Site ID a string? "; var_dump(is_string($siteId)); echo "\n"; $identifiers = []; $identifiers[$siteId->getId()][] = 'test'; var_dump(array_keys($identifiers));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MdYUI
function name:  (null)
number of ops:  23
compiled vars:  !0 = $siteId, !1 = $identifiers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'SiteId'
          1        SEND_VAL_EX                                              '1'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   20     4        ECHO                                                     'Is+Site+ID+a+string%3F++'
   21     5        INIT_FCALL                                               'var_dump'
          6        TYPE_CHECK                                   64  ~5      !0
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
   23     9        ECHO                                                     '%0A'
   25    10        ASSIGN                                                   !1, <array>
   27    11        INIT_METHOD_CALL                                         !0, 'getId'
         12        DO_FCALL                                      0  $8      
         13        FETCH_DIM_W                                      $9      !1, $8
         14        ASSIGN_DIM                                               $9
         15        OP_DATA                                                  'test'
   29    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'array_keys'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class SiteId:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MdYUI
function name:  __construct
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'id'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function getid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MdYUI
function name:  getId
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'id'
          1      > RETURN                                                   ~0
   15     2*     > RETURN                                                   null

End of function getid

End of class SiteId.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.63 ms | 1396 KiB | 17 Q