3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Expressions { function foo() { // Examples based on php-parser expression types static $array = [1, 2, 3], $arrayDimFetch = [1,2][0], $arrayItem = ['a' => 1], $binaryBitwiseAnd = 1 & 2, $binaryConcat = "a" . "b", $binaryIdentical = 1 === 1, $binaryPlus = 1 + 2, $binarySpaceship = 1 <=> 2, $bitwiseNot = ~1, $booleanAnd = 1 && 2, $booleanNot = !false, $classConstFetch = self::class, $coalesce = 1 ?? 2, $constFetch = PHP_EOL, $new = new stdClass(), $scalarFloat = 3.14, $scalarInteger = 123, $scalarMagicConst = __LINE__, $scalarString = 'string', $ternary = true ? 1 : 2, $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/GGfhX
function name:  (null)
number of ops:  6
compiled vars:  !0 = $expr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $1      'Expressions'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   34     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/GGfhX
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
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   10     1        BIND_STATIC                                              !1
   11     2        BIND_STATIC                                              !2
   12     3        BIND_STATIC                                              !3
   13     4        BIND_STATIC                                              !4
   14     5        BIND_STATIC                                              !5
   15     6        BIND_STATIC                                              !6
   16     7        BIND_STATIC                                              !7
   17     8        BIND_STATIC                                              !8
   18     9        BIND_STATIC                                              !9
   19    10        BIND_STATIC                                              !10
   20    11        BIND_STATIC                                              !11
   21    12        BIND_STATIC                                              !12
   22    13        BIND_STATIC                                              !13
   23    14        ZEND_BIND_INIT_STATIC_OR_JMP                             !14
         15        NEW                                              $21     'stdClass'
         16        DO_FCALL                                      0          
         17        BIND_STATIC                                              !14, $21
   24    18        BIND_STATIC                                              !15
   25    19        BIND_STATIC                                              !16
   26    20        BIND_STATIC                                              !17
   27    21        BIND_STATIC                                              !18
   28    22        BIND_STATIC                                              !19
   29    23        BIND_STATIC                                              !20
   30    24      > RETURN                                                   null

End of function foo

End of class Expressions.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.41 ms | 1011 KiB | 13 Q