3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Fish { public $common_name; public $flavor; public $record_weight; function __construct($name, $flavor, $record){ $this->common_name = $name; $this->flavor = $flavor; $this->record_weight= $record; } public function getInfo(){ return "A Largemouth Bass is an Excellent flavored fish. The world record weight is 22 pounds 5 ounces." . $this->$common_name . $this->$flavor . $this->$record_weight; } } $f = new Fish(); $bass = new Fish("Largemouth Bass","Excellent","22 pounds 5 ounces"); echo $f->getInfo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/017ZY
function name:  (null)
number of ops:  13
compiled vars:  !0 = $f, !1 = $bass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $2      'Fish'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   27     3        NEW                                              $5      'Fish'
          4        SEND_VAL_EX                                              'Largemouth+Bass'
          5        SEND_VAL_EX                                              'Excellent'
          6        SEND_VAL_EX                                              '22+pounds+5+ounces'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $5
   28     9        INIT_METHOD_CALL                                         !0, 'getInfo'
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
         12      > RETURN                                                   1

Class Fish:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/017ZY
function name:  __construct
number of ops:  10
compiled vars:  !0 = $name, !1 = $flavor, !2 = $record
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   12     3        ASSIGN_OBJ                                               'common_name'
          4        OP_DATA                                                  !0
   13     5        ASSIGN_OBJ                                               'flavor'
          6        OP_DATA                                                  !1
   14     7        ASSIGN_OBJ                                               'record_weight'
          8        OP_DATA                                                  !2
   15     9      > RETURN                                                   null

End of function __construct

Function getinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/017ZY
function name:  getInfo
number of ops:  8
compiled vars:  !0 = $common_name, !1 = $flavor, !2 = $record_weight
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~3      !0
          1        CONCAT                                           ~4      'A+Largemouth+Bass+is+an+Excellent+flavored+fish.+The+world+record+weight+is+22+pounds+5+ounces.', ~3
   20     2        FETCH_OBJ_R                                      ~5      !1
          3        CONCAT                                           ~6      ~4, ~5
   21     4        FETCH_OBJ_R                                      ~7      !2
          5        CONCAT                                           ~8      ~6, ~7
          6      > RETURN                                                   ~8
   22     7*     > RETURN                                                   null

End of function getinfo

End of class Fish.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.98 ms | 1386 KiB | 13 Q