3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Example to Set and Get a property outside object * * @author Yousef Ismaeil Cliprz[At]Gmail[Dot]com */ class Apple { /** * Device name * * @var string * @access public */ public $device; } // Create object $apple = new Apple(); // Set device name $apple->device = 'iPhone'; // set a new property $apple->version = '4s'; // 4s for example // Get the Apple::$device property and the new property Apple::$version echo ("This is Apple {$apple->device} version {$apple->version}");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q6s1s
function name:  (null)
number of ops:  15
compiled vars:  !0 = $apple
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Apple'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        ASSIGN_OBJ                                               !0, 'device'
          4        OP_DATA                                                  'iPhone'
   28     5        ASSIGN_OBJ                                               !0, 'version'
          6        OP_DATA                                                  '4s'
   31     7        ROPE_INIT                                     4  ~9      'This+is+Apple+'
          8        FETCH_OBJ_R                                      ~6      !0, 'device'
          9        ROPE_ADD                                      1  ~9      ~9, ~6
         10        ROPE_ADD                                      2  ~9      ~9, '+version+'
         11        FETCH_OBJ_R                                      ~7      !0, 'version'
         12        ROPE_END                                      3  ~8      ~9, ~7
         13        ECHO                                                     ~8
         14      > RETURN                                                   1

Class Apple: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.7 ms | 1393 KiB | 13 Q