3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Expressions { public $a = 1; function foo() { // Examples based on php-parser expression types static $array = [1, 2, 3]; static $arrayDimFetch = [1,2][0]; static $arrayItem = ['a' => 1]; static $binaryBitwiseAnd = 1 & 2; static $binaryConcat = "a" . "b"; static $binaryIdentical = 1 === 1; static $binaryPlus = 1 + 2; static $binarySpaceship = 1 <=> 2; static $bitwiseNot = ~1; static $booleanAnd = 1 && 2; static $booleanNot = !false; static $classConstFetch = self::class; static $coalesce = 1 ?? 2; static $constFetch = PHP_EOL; static $new = new stdClass(); static $scalarFloat = 3.14; static $scalarInteger = 123; static $scalarMagicConst = __LINE__; static $scalarString = 'string'; static $ternary = true ? 1 : 2; static $unaryPlus = +1; } } $expr = new Expressions(); $expr->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ft4IV
function name:  (null)
number of ops:  6
compiled vars:  !0 = $expr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $1      'Expressions'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   35     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Expressions:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ft4IV
function name:  foo
number of ops:  25
compiled vars:  !0 = $array, !1 = $arrayDimFetch, !2 = $arrayItem, !3 = $binaryBitwiseAnd, !4 = $binaryConcat, !5 = $binaryIdentical, !6 = $binaryPlus, !7 = $binarySpaceship, !8 = $bitwiseNot, !9 = $booleanAnd, !10 = $booleanNot, !11 = $classConstFetch, !12 = $coalesce, !13 = $constFetch, !14 = $new, !15 = $scalarFloat, !16 = $scalarInteger, !17 = $scalarMagicConst, !18 = $scalarString, !19 = $ternary, !20 = $unaryPlus
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   BIND_STATIC                                              !0
   11     1        BIND_STATIC                                              !1
   12     2        BIND_STATIC                                              !2
   13     3        BIND_STATIC                                              !3
   14     4        BIND_STATIC                                              !4
   15     5        BIND_STATIC                                              !5
   16     6        BIND_STATIC                                              !6
   17     7        BIND_STATIC                                              !7
   18     8        BIND_STATIC                                              !8
   19     9        BIND_STATIC                                              !9
   20    10        BIND_STATIC                                              !10
   21    11        BIND_STATIC                                              !11
   22    12        BIND_STATIC                                              !12
   23    13        BIND_STATIC                                              !13
   24    14        ZEND_BIND_INIT_STATIC_OR_JMP                             !14
         15        NEW                                              $21     'stdClass'
         16        DO_FCALL                                      0          
         17        BIND_STATIC                                              !14, $21
   25    18        BIND_STATIC                                              !15
   26    19        BIND_STATIC                                              !16
   27    20        BIND_STATIC                                              !17
   28    21        BIND_STATIC                                              !18
   29    22        BIND_STATIC                                              !19
   30    23        BIND_STATIC                                              !20
   31    24      > RETURN                                                   null

End of function foo

End of class Expressions.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.56 ms | 1011 KiB | 13 Q