3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function isPerfect($n) { return count($n)==4&&$n[0]*$n[1]*$n[2]*$n[3]+1==$n[0]**2+3*$n[0]+1**2; } var_dump(isPerfect(['a','b','c','d']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ZKqC
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'isperfect'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function isperfect:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/9ZKqC
function name:  isPerfect
number of ops:  22
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        COUNT                                            ~1      !0
          2        IS_EQUAL                                         ~2      ~1, 4
          3      > JMPZ_EX                                          ~2      ~2, ->20
          4    >   FETCH_DIM_R                                      ~3      !0, 0
          5        FETCH_DIM_R                                      ~4      !0, 1
          6        MUL                                              ~5      ~3, ~4
          7        FETCH_DIM_R                                      ~6      !0, 2
          8        MUL                                              ~7      ~5, ~6
          9        FETCH_DIM_R                                      ~8      !0, 3
         10        MUL                                              ~9      ~7, ~8
         11        ADD                                              ~10     ~9, 1
         12        FETCH_DIM_R                                      ~11     !0, 0
         13        POW                                              ~12     ~11, 2
         14        FETCH_DIM_R                                      ~13     !0, 0
         15        MUL                                              ~14     ~13, 3
         16        ADD                                              ~15     ~12, ~14
         17        ADD                                              ~16     ~15, 1
         18        IS_EQUAL                                         ~17     ~10, ~16
         19        BOOL                                             ~2      ~17
         20    > > RETURN                                                   ~2
    6    21*     > RETURN                                                   null

End of function isperfect

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.59 ms | 1399 KiB | 16 Q