3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Artist implements ArrayAccess { public $artist_name; function __construct($name) { $this->artist_name = $name; } function offsetGet($name) { return $this->$name; } function offsetExists($name) { return isset($this->$name); } function offsetSet($name, $value) { $this->$name = $value; } function offsetUnset($name) { unset($this->$name); } } $artists = array( new Artist('Dali'), new Artist('Picasso'), new Artist('Titian'), ); echo implode(', ', array_column($artists, 'artist_name')), "\n"; /*****/
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9rYC7
function name:  (null)
number of ops:  25
compiled vars:  !0 = $artists
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'artist'
   23     1        NEW                                              $1      'Artist'
          2        SEND_VAL_EX                                              'Dali'
          3        DO_FCALL                                      0          
          4        INIT_ARRAY                                       ~3      $1
   24     5        NEW                                              $4      'Artist'
          6        SEND_VAL_EX                                              'Picasso'
          7        DO_FCALL                                      0          
          8        ADD_ARRAY_ELEMENT                                ~3      $4
   25     9        NEW                                              $6      'Artist'
         10        SEND_VAL_EX                                              'Titian'
         11        DO_FCALL                                      0          
         12        ADD_ARRAY_ELEMENT                                ~3      $6
   22    13        ASSIGN                                                   !0, ~3
   27    14        INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 '%2C+'
         16        INIT_FCALL                                               'array_column'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 'artist_name'
         19        DO_ICALL                                         $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                         $10     
         22        ECHO                                                     $10
         23        ECHO                                                     '%0A'
   28    24      > RETURN                                                   1

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

End of function __construct

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9rYC7
function name:  offsetGet
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function offsetget

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9rYC7
function name:  offsetExists
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ISSET_ISEMPTY_PROP_OBJ                           ~1      !0
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function offsetexists

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9rYC7
function name:  offsetSet
number of ops:  5
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   16     4      > RETURN                                                   null

End of function offsetset

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9rYC7
function name:  offsetUnset
number of ops:  3
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        UNSET_OBJ                                                !0
   19     2      > RETURN                                                   null

End of function offsetunset

End of class Artist.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.41 ms | 1405 KiB | 17 Q