3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SiteId { protected $id; public function __construct($id) { var_dump($id); $this->id = $id; } public function getId() { var_dump($this->id); return $this->id; } } $id = "1"; var_dump($id); $siteId = new SiteId($id); 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/jsPkO
function name:  (null)
number of ops:  27
compiled vars:  !0 = $id, !1 = $siteId, !2 = $identifiers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ASSIGN                                                   !0, '1'
   22     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   24     4        NEW                                              $5      'SiteId'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   26     8        ECHO                                                     'Is+Site+ID+a+string%3F++'
   27     9        INIT_FCALL                                               'var_dump'
         10        TYPE_CHECK                                   64  ~8      !1
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                                 
   29    13        ECHO                                                     '%0A'
   31    14        ASSIGN                                                   !2, <array>
   33    15        INIT_METHOD_CALL                                         !1, 'getId'
         16        DO_FCALL                                      0  $11     
         17        FETCH_DIM_W                                      $12     !2, $11
         18        ASSIGN_DIM                                               $12
         19        OP_DATA                                                  'test'
   35    20        INIT_FCALL                                               'var_dump'
         21        INIT_FCALL                                               'array_keys'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $14     
         24        SEND_VAR                                                 $14
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Class SiteId:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jsPkO
function name:  __construct
number of ops:  7
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   10     4        ASSIGN_OBJ                                               'id'
          5        OP_DATA                                                  !0
   11     6      > 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/jsPkO
function name:  getId
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'id'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   16     4        FETCH_OBJ_R                                      ~2      'id'
          5      > RETURN                                                   ~2
   17     6*     > RETURN                                                   null

End of function getid

End of class SiteId.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.01 ms | 1404 KiB | 18 Q