3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass { static $_cat; public function setCat($val) { self::$_cat = $val; } public function getCat() { return self::$_cat; } } TestClass::setCat('fluffles'); $testClass = new TestClass(); TestClass::setCat('mittens'); $testClassTwo = new TestClass(); echo $testClass->getCat(); echo $testClassTwo->getCat();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VtpvY
function name:  (null)
number of ops:  19
compiled vars:  !0 = $testClass, !1 = $testClassTwo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'TestClass', 'setCat'
          1        SEND_VAL                                                 'fluffles'
          2        DO_FCALL                                      0          
   18     3        NEW                                              $3      'TestClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   20     6        INIT_STATIC_METHOD_CALL                                  'TestClass', 'setCat'
          7        SEND_VAL                                                 'mittens'
          8        DO_FCALL                                      0          
   22     9        NEW                                              $7      'TestClass'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   24    12        INIT_METHOD_CALL                                         !0, 'getCat'
         13        DO_FCALL                                      0  $10     
         14        ECHO                                                     $10
   25    15        INIT_METHOD_CALL                                         !1, 'getCat'
         16        DO_FCALL                                      0  $11     
         17        ECHO                                                     $11
         18      > RETURN                                                   1

Class TestClass:
Function setcat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VtpvY
function name:  setCat
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_STATIC_PROP                                       '_cat'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function setcat

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

End of function getcat

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.34 ms | 1395 KiB | 13 Q