3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Student { private $classes; public function __construct($classes) { $this->classes = $classes; } public function getClasses() { return $this->classes; } } $mary = new Student(['CompSci2001', 'CompSci2002']); var_dump($mary->getClasses());
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/3nLfb
function name:  (null)
number of ops:  11
compiled vars:  !0 = $mary
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  19     1        NEW                                              $2      :-6
         2        SEND_VAL_EX                                              <array>
         3        DO_FCALL                                      0          
         4        ASSIGN                                                   !0, $2
  21     5        INIT_FCALL                                               'var_dump'
         6        INIT_METHOD_CALL                                         !0, 'getClasses'
         7        DO_FCALL                                      0  $5      
         8        SEND_VAR                                                 $5
         9        DO_ICALL                                                 
        10      > RETURN                                                   1

Class Student:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/3nLfb
function name:  __construct
number of ops:  4
compiled vars:  !0 = $classes
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   7     0  E >   RECV                                             !0      
   9     1        ASSIGN_OBJ                                               'classes'
         2        OP_DATA                                                  !0
  10     3      > RETURN                                                   null

End of function __construct

Function getclasses:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/3nLfb
function name:  getClasses
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  14     0  E >   FETCH_OBJ_R                                      $0      'classes'
         1      > RETURN                                                   $0
  15     2*     > RETURN                                                   null

End of function getclasses

End of class Student.

Generated using Vulcan Logic Dumper, using php 7.2.0