diff --git a/src/ephp_func_vars.erl b/src/ephp_func_vars.erl index 6a03d43f..af6d0f46 100644 --- a/src/ephp_func_vars.erl +++ b/src/ephp_func_vars.erl @@ -182,7 +182,7 @@ empty(_Context, {_,Value}) -> gettype(_Context, {_,Value}) when is_boolean(Value) -> <<"boolean">>; gettype(_Context, {_,Value}) when is_integer(Value) -> <<"integer">>; -gettype(_Context, {_,Value}) when is_float(Value) -> <<"double">>; +gettype(_Context, {_,Value}) when is_float(Value) -> <<"float">>; gettype(_Context, {_,Value}) when is_binary(Value) -> <<"string">>; gettype(_Context, {_,Value}) when ?IS_DICT(Value) -> <<"array">>; gettype(_Context, {_,Value}) when is_record(Value, reg_instance) -> <<"object">>; @@ -216,7 +216,7 @@ var_dump_fmt(_Context, Value, _Spaces) when is_integer(Value) -> <<"int(",(ephp_util:to_bin(Value))/binary, ")\n">>; var_dump_fmt(_Context, Value, _Spaces) when is_float(Value) -> - <<"double(",(ephp_util:to_bin(Value))/binary, ")\n">>; + <<"float(",(ephp_util:to_bin(Value))/binary, ")\n">>; var_dump_fmt(_Context, Value, _Spaces) when is_binary(Value) -> Size = ephp_util:to_bin(byte_size(Value)), @@ -244,13 +244,13 @@ var_dump_fmt(Context, Value, Spaces) when is_list(Value) -> Res ++ case var_dump_fmt(Context, Val, <>) of V when is_binary(V) -> [ - <\n", + <\n", Spaces/binary, V/binary>> ]; V when is_list(V) -> Elements = ephp_util:to_bin(length(Val)), [ - <\n">>, + <\n">>, <> ] ++ V ++ [ <> diff --git a/test/code/array_01.out b/test/code/array_01.out index b46358ef..bd05297b 100644 --- a/test/code/array_01.out +++ b/test/code/array_01.out @@ -1,55 +1,55 @@ array(0) { } array(3) { - [0] => + [0]=> int(1) - [1] => + [1]=> int(2) - [2] => + [2]=> int(3) } array(2) { - [0] => + [0]=> int(1) - [1] => + [1]=> int(2) } array(2) { - ["a"] => - string(7) "a thing" - ["h"] => + ["a"]=> string(5) "hello" + ["b"]=> + string(7) "a thing" } array(2) { - ["a"] => - string(7) "a thing" - ["h"] => + ["a"]=> string(5) "hello" + ["b"]=> + string(7) "a thing" } array(2) { - [0] => + [0]=> array(3) { - [0] => + [0]=> int(1) - [1] => + [1]=> int(2) - [2] => + [2]=> int(3) } - [1] => + [1]=> array(2) { - [0] => + [0]=> string(1) "a" - [1] => + [1]=> string(1) "b" } } array(1) { - ["hola"] => + ["hola"]=> array(2) { - [0] => + [0]=> string(1) "1" - [1] => + [1]=> string(1) "2" } } diff --git a/test/code/array_01.php b/test/code/array_01.php index 9442fe4d..3a872c40 100644 --- a/test/code/array_01.php +++ b/test/code/array_01.php @@ -9,12 +9,12 @@ $_MESSAGE = array( 0 => 1, 1 => 2 ); var_dump($_MESSAGE); -$_MESSAGE = array( 'h' => 'hello', 'a' => 'a thing' ); +$_MESSAGE = array( 'a' => 'hello', 'b' => 'a thing' ); var_dump($_MESSAGE); $_MESSAGE = array( - 'h' => 'hello', - 'a' => 'a thing', + 'a' => 'hello', + 'b' => 'a thing', ); var_dump($_MESSAGE); diff --git a/test/code/test_func_var_dump.out b/test/code/test_func_var_dump.out index 531083c0..2eddb0a2 100644 --- a/test/code/test_func_var_dump.out +++ b/test/code/test_func_var_dump.out @@ -1,60 +1,60 @@ array(3) { - [0] => + [0]=> int(1) - [1] => + [1]=> array(3) { - [0] => + [0]=> array(2) { - [0] => + [0]=> string(1) "a" - [1] => + [1]=> string(1) "b" } - [1] => - double(4.5) - [2] => + [1]=> + float(4.5) + [2]=> string(4) "hola" } - [2] => + [2]=> int(3) } array(3) { - [0] => + [0]=> int(1) - [1] => + [1]=> array(3) { - [0] => + [0]=> array(2) { - [0] => + [0]=> string(1) "a" - [1] => + [1]=> string(1) "b" } - [1] => - double(4.5) - [2] => + [1]=> + float(4.5) + [2]=> string(4) "hola" } - [2] => + [2]=> int(3) } array(3) { - [0] => + [0]=> int(1) - [1] => + [1]=> array(3) { - [0] => + [0]=> array(2) { - [0] => + [0]=> string(1) "a" - [1] => + [1]=> string(1) "b" } - [1] => - double(4.5) - [2] => + [1]=> + float(4.5) + [2]=> string(4) "hola" } - [2] => + [2]=> int(3) } diff --git a/test/code/test_include_value.out b/test/code/test_include_value.out index 2f0a949d..acc0f64f 100644 --- a/test/code/test_include_value.out +++ b/test/code/test_include_value.out @@ -1,17 +1,17 @@ array(3) { - [0] => + [0]=> int(1) - [1] => + [1]=> int(2) - [2] => + [2]=> int(3) } array(3) { - [0] => + [0]=> int(1) - [1] => + [1]=> int(2) - [2] => + [2]=> int(3) } bool(true)