3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Products{ // Properties protected $_title; protected $_category; public static $error = "Fout opgetreden"; protected static $_changes_saved = "Wijzigingen opgeslagen"; // Methods public function __construct($title, $category){ $this->_title = $title; $this->_category = $category; } public function someFunction(){ self::$_changes_saved; } public static function convertMeterToCentimeter($meter){ return $meter * 100; } public function Length(){ $length = self::convertMeterToCentimeter(3); } public function getCategory(){ return $this->_category; } public function getTitle(){ return $this->_title; } } echo Products::$error; // displays Fout opgetreden echo Products::convertMeterToCentimeter(2); //displays 200
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u885a
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'error'
          1        ECHO                                                     ~0
   32     2        INIT_STATIC_METHOD_CALL                                  'Products', 'convertMeterToCentimeter'
          3        SEND_VAL                                                 2
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
          6      > RETURN                                                   1

Class Products:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u885a
function name:  __construct
number of ops:  7
compiled vars:  !0 = $title, !1 = $category
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        ASSIGN_OBJ                                               '_title'
          3        OP_DATA                                                  !0
   12     4        ASSIGN_OBJ                                               '_category'
          5        OP_DATA                                                  !1
   13     6      > RETURN                                                   null

End of function __construct

Function somefunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u885a
function name:  someFunction
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      '_changes_saved'
          1        FREE                                                     ~0
   16     2      > RETURN                                                   null

End of function somefunction

Function convertmetertocentimeter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u885a
function name:  convertMeterToCentimeter
number of ops:  4
compiled vars:  !0 = $meter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        MUL                                              ~1      !0, 100
          2      > RETURN                                                   ~1
   19     3*     > RETURN                                                   null

End of function convertmetertocentimeter

Function length:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u885a
function name:  Length
number of ops:  5
compiled vars:  !0 = $length
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                  'convertMeterToCentimeter'
          1        SEND_VAL                                                 3
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   22     4      > RETURN                                                   null

End of function length

Function getcategory:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u885a
function name:  getCategory
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      '_category'
          1      > RETURN                                                   ~0
   25     2*     > RETURN                                                   null

End of function getcategory

Function gettitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u885a
function name:  getTitle
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   FETCH_OBJ_R                                      ~0      '_title'
          1      > RETURN                                                   ~0
   28     2*     > RETURN                                                   null

End of function gettitle

End of class Products.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.2 ms | 1399 KiB | 13 Q