3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Character { public $UID; public $Name; /* Other Variables */ public function __construct($conection, $UID) { #$details = $conection->prepare("SELECT * FROM Character_Details WHERE UID = ?"); #$details->bindParam(1, $UID); #$details->execute(); #$myDetails = $details->fetch(); $this->aName = 'Stuff'; # $myDetails['Name']; echo $this->aName . ': '; /* More variables set */ } public function DescribeMe() { echo "Character Description for: {$this->aName}"; /* Scenario A */ echo "Character Description for: {$aName}"; /* Scenario B */ echo "Character Description for: {self::$aName}"; /* Scenario C */ } } $char = new Character('param', 'param');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vpC5B
function name:  (null)
number of ops:  6
compiled vars:  !0 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'Character'
          1        SEND_VAL_EX                                              'param'
          2        SEND_VAL_EX                                              'param'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
          5      > RETURN                                                   1

Class Character:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vpC5B
function name:  __construct
number of ops:  8
compiled vars:  !0 = $conection, !1 = $UID
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        ASSIGN_OBJ                                               'aName'
          3        OP_DATA                                                  'Stuff'
   15     4        FETCH_OBJ_R                                      ~3      'aName'
          5        CONCAT                                           ~4      ~3, '%3A++'
          6        ECHO                                                     ~4
   17     7      > RETURN                                                   null

End of function __construct

Function describeme:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vpC5B
function name:  DescribeMe
number of ops:  12
compiled vars:  !0 = $aName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NOP                                                      
          1        FETCH_OBJ_R                                      ~1      'aName'
          2        FAST_CONCAT                                      ~2      'Character+Description+for%3A+', ~1
          3        ECHO                                                     ~2
   22     4        NOP                                                      
          5        FAST_CONCAT                                      ~3      'Character+Description+for%3A+', !0
          6        ECHO                                                     ~3
   23     7        ROPE_INIT                                     3  ~5      'Character+Description+for%3A+%7Bself%3A%3A'
          8        ROPE_ADD                                      1  ~5      ~5, !0
          9        ROPE_END                                      2  ~4      ~5, '%7D'
         10        ECHO                                                     ~4
   24    11      > RETURN                                                   null

End of function describeme

End of class Character.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.35 ms | 1395 KiB | 13 Q