3v4l.org

run code in 300+ PHP versions simultaneously
<?php $schema = Array( Array("prestation_1" => 123, "prestataire_1" => 321, "prestation_2" => 456, "prestataire_2" => 654), Array("prestation_1" => 123, "prestataire_1" => 321, "prestation_2" => 456, "prestataire_2" => 654), Array("prestation_1" => 123, "prestataire_1" => 3241, "prestation_2" => 4956, "prestataire_2" => 654), Array("prestation_1" => 123, "prestataire_1" => 321, "prestation_2" => 456, "prestataire_2" => 654) ); function check( $array) { $array=array_values($array); $k=0; for($i=0;$i<count($array);$i++) { if(count($array)-1 > $i) { if($array[$i] == $array[$i]) $k=0; else $k=1; } } if($k == 0) return $array[0]; else return array(); } print_r(check($schema)) ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRj3f
function name:  (null)
number of ops:  8
compiled vars:  !0 = $schema
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   30     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'check'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function check:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 8
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 8
Branch analysis from position: 23
Branch analysis from position: 8
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 8
Branch analysis from position: 23
Branch analysis from position: 8
Branch analysis from position: 19
filename:       /in/cRj3f
function name:  check
number of ops:  30
compiled vars:  !0 = $array, !1 = $k, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'array_values'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
   12     5        ASSIGN                                                   !1, 0
   13     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->20
   15     8    >   COUNT                                            ~7      !0
          9        SUB                                              ~8      ~7, 1
         10        IS_SMALLER                                               !2, ~8
         11      > JMPZ                                                     ~9, ->19
   17    12    >   FETCH_DIM_R                                      ~10     !0, !2
         13        FETCH_DIM_R                                      ~11     !0, !2
         14        IS_EQUAL                                                 ~10, ~11
         15      > JMPZ                                                     ~12, ->18
   18    16    >   ASSIGN                                                   !1, 0
         17      > JMP                                                      ->19
   20    18    >   ASSIGN                                                   !1, 1
   13    19    >   PRE_INC                                                  !2
         20    >   COUNT                                            ~16     !0
         21        IS_SMALLER                                               !2, ~16
         22      > JMPNZ                                                    ~17, ->8
   23    23    >   IS_EQUAL                                                 !1, 0
         24      > JMPZ                                                     ~18, ->28
   24    25    >   FETCH_DIM_R                                      ~19     !0, 0
         26      > RETURN                                                   ~19
         27*       JMP                                                      ->29
   26    28    > > RETURN                                                   <array>
   27    29*     > RETURN                                                   null

End of function check

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.68 ms | 1403 KiB | 18 Q