diff --git a/Zend/tests/zpp/array_ht_or_long_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/array_ht_or_long_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..d34c2d88da4a --- /dev/null +++ b/Zend/tests/zpp/array_ht_or_long_zpp_specifier_strict_mode.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test array_ht_or_long ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_ht_or_long($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_or_long_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, null given +NULL +Using false: +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, false given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, false given +Using true: +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, true given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, true given +Using 42: +int(42) +int(42) +Using 73.5: +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, float given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, float given +Using 'string': +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, string given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, string given +Using '15': +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, string given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, string given +Using '56.7': +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, string given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, string given +Using 'stdClass': +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, string given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, string given +Using anon class name: +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, string given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, string given +Using []: +array(0) { +} +array(0) { +} +Using new stdClass(): +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, stdClass given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, stdClass given +Using new S(): +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, S given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, S given +Using STDOUT: +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, resource given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, resource given diff --git a/Zend/tests/zpp/array_ht_or_long_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/array_ht_or_long_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..410da6a7f59a --- /dev/null +++ b/Zend/tests/zpp/array_ht_or_long_zpp_specifier_weak_mode.phpt @@ -0,0 +1,79 @@ +--TEST-- +Test array_ht_or_long ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_ht_or_long($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_or_long_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: + +Deprecated: zend_array_ht_or_long(): Passing null to parameter #1 ($param) of type array|int is deprecated in %s on line %d +int(0) +NULL +Using false: +int(0) +int(0) +Using true: +int(1) +int(1) +Using 42: +int(42) +int(42) +Using 73.5: + +Deprecated: Implicit conversion from float 73.5 to int loses precision in %s on line %d +int(73) + +Deprecated: Implicit conversion from float 73.5 to int loses precision in %s on line %d +int(73) +Using 'string': +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, string given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, string given +Using '15': +int(15) +int(15) +Using '56.7': + +Deprecated: Implicit conversion from float-string "56.7" to int loses precision in %s on line %d +int(56) + +Deprecated: Implicit conversion from float-string "56.7" to int loses precision in %s on line %d +int(56) +Using 'stdClass': +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, string given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, string given +Using anon class name: +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, string given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, string given +Using []: +array(0) { +} +array(0) { +} +Using new stdClass(): +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, stdClass given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, stdClass given +Using new S(): +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, S given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, S given +Using STDOUT: +TypeError: zend_array_ht_or_long(): Argument #1 ($param) must be of type array|int, resource given +TypeError: zend_array_ht_or_long_or_null(): Argument #1 ($param) must be of type array|int|null, resource given diff --git a/Zend/tests/zpp/array_ht_or_str_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/array_ht_or_str_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..30523300650c --- /dev/null +++ b/Zend/tests/zpp/array_ht_or_str_zpp_specifier_strict_mode.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test array_ht_or_str ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_ht_or_str($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_or_str_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, null given +NULL +Using false: +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, false given +TypeError: zend_array_ht_or_str_or_null(): Argument #1 ($param) must be of type array|string|null, false given +Using true: +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, true given +TypeError: zend_array_ht_or_str_or_null(): Argument #1 ($param) must be of type array|string|null, true given +Using 42: +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, int given +TypeError: zend_array_ht_or_str_or_null(): Argument #1 ($param) must be of type array|string|null, int given +Using 73.5: +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, float given +TypeError: zend_array_ht_or_str_or_null(): Argument #1 ($param) must be of type array|string|null, float given +Using 'string': +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +array(0) { +} +array(0) { +} +Using new stdClass(): +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, stdClass given +TypeError: zend_array_ht_or_str_or_null(): Argument #1 ($param) must be of type array|string|null, stdClass given +Using new S(): +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, S given +TypeError: zend_array_ht_or_str_or_null(): Argument #1 ($param) must be of type array|string|null, S given +Using STDOUT: +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, resource given +TypeError: zend_array_ht_or_str_or_null(): Argument #1 ($param) must be of type array|string|null, resource given diff --git a/Zend/tests/zpp/array_ht_or_str_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/array_ht_or_str_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..1308ea673a2e --- /dev/null +++ b/Zend/tests/zpp/array_ht_or_str_zpp_specifier_weak_mode.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test array_ht_or_str ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_ht_or_str($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_or_str_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: + +Deprecated: zend_array_ht_or_str(): Passing null to parameter #1 ($param) of type array|string is deprecated in %s on line %d +string(0) "" +NULL +Using false: +string(0) "" +string(0) "" +Using true: +string(1) "1" +string(1) "1" +Using 42: +string(2) "42" +string(2) "42" +Using 73.5: +string(4) "73.5" +string(4) "73.5" +Using 'string': +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +array(0) { +} +array(0) { +} +Using new stdClass(): +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, stdClass given +TypeError: zend_array_ht_or_str_or_null(): Argument #1 ($param) must be of type array|string|null, stdClass given +Using new S(): +string(7) "S class" +string(7) "S class" +Using STDOUT: +TypeError: zend_array_ht_or_str(): Argument #1 ($param) must be of type array|string, resource given +TypeError: zend_array_ht_or_str_or_null(): Argument #1 ($param) must be of type array|string|null, resource given diff --git a/Zend/tests/zpp/array_ht_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/array_ht_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..86d5b6759cc3 --- /dev/null +++ b/Zend/tests/zpp/array_ht_zpp_specifier_strict_mode.phpt @@ -0,0 +1,152 @@ +--TEST-- +Test array_ht ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_ht($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_array_ht_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, null given +NULL +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, null given +NULL +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, null given +Using false: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, false given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, false given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, false given +Using true: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, true given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, true given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, true given +Using 42: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, int given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, int given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, int given +Using 73.5: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, float given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, float given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, float given +Using 'string': +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '15': +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '56.7': +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using 'stdClass': +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using anon class name: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, stdClass given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, stdClass given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, stdClass given +Using new S(): +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, S given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, S given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, S given +Using STDOUT: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, resource given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, resource given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, resource given diff --git a/Zend/tests/zpp/array_ht_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/array_ht_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..5309902cfe6a --- /dev/null +++ b/Zend/tests/zpp/array_ht_zpp_specifier_weak_mode.phpt @@ -0,0 +1,150 @@ +--TEST-- +Test array_ht ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_ht($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_ht_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_array_ht_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, null given +NULL +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, null given +NULL +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, null given +Using false: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, false given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, false given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, false given +Using true: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, true given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, true given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, true given +Using 42: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, int given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, int given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, int given +Using 73.5: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, float given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, float given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, float given +Using 'string': +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '15': +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '56.7': +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using 'stdClass': +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using anon class name: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, stdClass given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, stdClass given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, stdClass given +Using new S(): +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, S given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, S given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, S given +Using STDOUT: +TypeError: zend_array_ht(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_ht_or_null(): Argument #1 ($param) must be of type ?array, resource given +TypeError: zend_array_ht_separate(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_ht_slow_zpp(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_ht_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, resource given +TypeError: zend_array_ht_deref_separate(): Argument #1 ($param) must be of type array, resource given diff --git a/Zend/tests/zpp/array_or_object_ht_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/array_or_object_ht_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..269a54c1037d --- /dev/null +++ b/Zend/tests/zpp/array_or_object_ht_zpp_specifier_strict_mode.phpt @@ -0,0 +1,120 @@ +--TEST-- +Test array_or_object_ht ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_or_object_ht($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_object_ht_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_object_ht_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_array_or_object_ht_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, null given +Using false: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, false given +Using true: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, true given +Using 42: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, int given +Using 73.5: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, float given +Using 'string': +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '15': +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '56.7': +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using 'stdClass': +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using anon class name: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new S(): +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using STDOUT: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, resource given diff --git a/Zend/tests/zpp/array_or_object_ht_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/array_or_object_ht_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..d923c12f5f4b --- /dev/null +++ b/Zend/tests/zpp/array_or_object_ht_zpp_specifier_weak_mode.phpt @@ -0,0 +1,118 @@ +--TEST-- +Test array_or_object_ht ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_or_object_ht($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_object_ht_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_object_ht_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_array_or_object_ht_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, null given +Using false: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, false given +Using true: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, true given +Using 42: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, int given +Using 73.5: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, float given +Using 'string': +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '15': +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '56.7': +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using 'stdClass': +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using anon class name: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, string given +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new S(): +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using STDOUT: +TypeError: zend_array_or_object_ht(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_ht_separate(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_ht_slow_zpp(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_ht_deref_separate(): Argument #1 ($param) must be of type array, resource given diff --git a/Zend/tests/zpp/array_or_object_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/array_or_object_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..4cce83b7a470 --- /dev/null +++ b/Zend/tests/zpp/array_or_object_zpp_specifier_strict_mode.phpt @@ -0,0 +1,120 @@ +--TEST-- +Test array_or_object ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_or_object($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_object_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_object_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_array_or_object_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, null given +Using false: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, false given +Using true: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, true given +Using 42: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, int given +Using 73.5: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, float given +Using 'string': +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '15': +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '56.7': +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using 'stdClass': +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using anon class name: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +Using new S(): +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +Using STDOUT: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, resource given diff --git a/Zend/tests/zpp/array_or_object_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/array_or_object_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..3e959a1cd3fa --- /dev/null +++ b/Zend/tests/zpp/array_or_object_zpp_specifier_weak_mode.phpt @@ -0,0 +1,118 @@ +--TEST-- +Test array_or_object ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array_or_object($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_object_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_object_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_array_or_object_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, null given +Using false: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, false given +Using true: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, true given +Using 42: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, int given +Using 73.5: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, float given +Using 'string': +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '15': +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '56.7': +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using 'stdClass': +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using anon class name: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, string given +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +Using new S(): +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +Using STDOUT: +TypeError: zend_array_or_object(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_separate(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_slow_zpp(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_object_deref_separate(): Argument #1 ($param) must be of type array, resource given diff --git a/Zend/tests/zpp/array_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/array_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..1d8797df002c --- /dev/null +++ b/Zend/tests/zpp/array_zpp_specifier_strict_mode.phpt @@ -0,0 +1,152 @@ +--TEST-- +Test array ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_array_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_array(): Argument #1 ($param) must be of type array, null given +NULL +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, null given +NULL +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, null given +Using false: +TypeError: zend_array(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, false given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, false given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, false given +Using true: +TypeError: zend_array(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, true given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, true given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, true given +Using 42: +TypeError: zend_array(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, int given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, int given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, int given +Using 73.5: +TypeError: zend_array(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, float given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, float given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, float given +Using 'string': +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '15': +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '56.7': +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using 'stdClass': +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using anon class name: +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +TypeError: zend_array(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, stdClass given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, stdClass given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, stdClass given +Using new S(): +TypeError: zend_array(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, S given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, S given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, S given +Using STDOUT: +TypeError: zend_array(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, resource given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, resource given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, resource given diff --git a/Zend/tests/zpp/array_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/array_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..8b6231089dcd --- /dev/null +++ b/Zend/tests/zpp/array_zpp_specifier_weak_mode.phpt @@ -0,0 +1,150 @@ +--TEST-- +Test array ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_array($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_array_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_array_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_array(): Argument #1 ($param) must be of type array, null given +NULL +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, null given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, null given +NULL +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, null given +Using false: +TypeError: zend_array(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, false given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, false given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, false given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, false given +Using true: +TypeError: zend_array(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, true given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, true given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, true given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, true given +Using 42: +TypeError: zend_array(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, int given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, int given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, int given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, int given +Using 73.5: +TypeError: zend_array(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, float given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, float given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, float given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, float given +Using 'string': +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '15': +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using '56.7': +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using 'stdClass': +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using anon class name: +TypeError: zend_array(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, string given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, string given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, string given +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +TypeError: zend_array(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, stdClass given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, stdClass given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, stdClass given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, stdClass given +Using new S(): +TypeError: zend_array(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, S given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, S given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, S given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, S given +Using STDOUT: +TypeError: zend_array(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_null(): Argument #1 ($param) must be of type ?array, resource given +TypeError: zend_array_separate(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_slow_zpp(): Argument #1 ($param) must be of type array, resource given +TypeError: zend_array_or_null_slow_zpp(): Argument #1 ($param) must be of type ?array, resource given +TypeError: zend_array_deref_separate(): Argument #1 ($param) must be of type array, resource given diff --git a/Zend/tests/zpp/enum_zpp_specifier.phpt b/Zend/tests/zpp/enum_zpp_specifier.phpt new file mode 100644 index 000000000000..df1fb2127c37 --- /dev/null +++ b/Zend/tests/zpp/enum_zpp_specifier.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test Z_PARAM_ENUM specifier +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_enum($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, null given +Using false: +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, false given +Using true: +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, true given +Using 42: +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, int given +Using 73.5: +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, float given +Using 'string': +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, string given +Using '15': +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, string given +Using '56.7': +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, string given +Using 'stdClass': +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, string given +Using anon class name: +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, string given +Using []: +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, array given +Using new stdClass(): +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, stdClass given +Using new S(): +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, S given +Using STDOUT: +TypeError: zend_enum(): Argument #1 ($param) must be of type ZendTestUnitEnum, resource given +Using ZendTestUnitEnum::Foo: +int(1) diff --git a/Zend/tests/zpp/func_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/func_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..8ff6c1a6427f --- /dev/null +++ b/Zend/tests/zpp/func_zpp_specifier_strict_mode.phpt @@ -0,0 +1,153 @@ +--TEST-- +Test func ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_func($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_no_trampoline_free($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_no_trampoline_free_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +NULL +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +NULL +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +NULL +Using false: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using true: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using 42: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using 73.5: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using 'string': +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "string" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "string" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "string" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "string" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "string" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "string" not found or invalid function name +Using '15': +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "15" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "15" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "15" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "15" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "15" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "15" not found or invalid function name +Using '56.7': +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "56.7" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "56.7" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "56.7" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "56.7" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "56.7" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "56.7" not found or invalid function name +Using 'stdClass': +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "stdClass" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "stdClass" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "stdClass" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "stdClass" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "stdClass" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "stdClass" not found or invalid function name +Using anon class name: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "class@anonymous" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "class@anonymous" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "class@anonymous" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "class@anonymous" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "class@anonymous" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "class@anonymous" not found or invalid function name +Using []: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, array callback must have exactly two members +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, array callback must have exactly two members +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, array callback must have exactly two members +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, array callback must have exactly two members +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, array callback must have exactly two members +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, array callback must have exactly two members +Using new stdClass(): +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using new S(): +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using STDOUT: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using strlen: +string(6) "strlen" +string(6) "strlen" +string(6) "strlen" +string(6) "strlen" +string(6) "strlen" +string(6) "strlen" diff --git a/Zend/tests/zpp/func_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/func_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..a2ad79aabefb --- /dev/null +++ b/Zend/tests/zpp/func_zpp_specifier_weak_mode.phpt @@ -0,0 +1,151 @@ +--TEST-- +Test func ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_func($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_no_trampoline_free($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_no_trampoline_free_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_func_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +NULL +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +NULL +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +NULL +Using false: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using true: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using 42: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using 73.5: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using 'string': +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "string" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "string" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "string" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "string" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "string" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "string" not found or invalid function name +Using '15': +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "15" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "15" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "15" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "15" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "15" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "15" not found or invalid function name +Using '56.7': +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "56.7" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "56.7" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "56.7" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "56.7" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "56.7" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "56.7" not found or invalid function name +Using 'stdClass': +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "stdClass" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "stdClass" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "stdClass" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "stdClass" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "stdClass" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "stdClass" not found or invalid function name +Using anon class name: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, function "class@anonymous" not found or invalid function name +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, function "class@anonymous" not found or invalid function name +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, function "class@anonymous" not found or invalid function name +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, function "class@anonymous" not found or invalid function name +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, function "class@anonymous" not found or invalid function name +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, function "class@anonymous" not found or invalid function name +Using []: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, array callback must have exactly two members +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, array callback must have exactly two members +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, array callback must have exactly two members +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, array callback must have exactly two members +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, array callback must have exactly two members +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, array callback must have exactly two members +Using new stdClass(): +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using new S(): +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using STDOUT: +TypeError: zend_func(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_no_trampoline_free(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_no_trampoline_free_or_null(): Argument #1 ($param) must be a valid callback or null, no array or string given +TypeError: zend_func_slow_zpp(): Argument #1 ($param) must be a valid callback, no array or string given +TypeError: zend_func_or_null_slow_zpp(): Argument #1 ($param) must be a valid callback or null, no array or string given +Using strlen: +string(6) "strlen" +string(6) "strlen" +string(6) "strlen" +string(6) "strlen" +string(6) "strlen" +string(6) "strlen" diff --git a/Zend/tests/zpp/path_str_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/path_str_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..c62eeb66bb23 --- /dev/null +++ b/Zend/tests/zpp/path_str_zpp_specifier_strict_mode.phpt @@ -0,0 +1,113 @@ +--TEST-- +Test path_str ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_path_str($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_str_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_str_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_str_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, null given +NULL +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, null given +NULL +Using false: +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, false given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, false given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, false given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, false given +Using true: +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, true given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, true given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, true given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, true given +Using 42: +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, int given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, int given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, int given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, int given +Using 73.5: +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, float given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, float given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, float given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, float given +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +ValueError: zend_path_str(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_or_null(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_slow_zpp(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must not contain any null bytes +Using []: +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, array given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, array given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, array given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, array given +Using new stdClass(): +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, stdClass given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, stdClass given +Using new S(): +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, S given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, S given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, S given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, S given +Using STDOUT: +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, resource given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, resource given +Using "foo\0bar": +ValueError: zend_path_str(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_or_null(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_slow_zpp(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must not contain any null bytes diff --git a/Zend/tests/zpp/path_str_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/path_str_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..fa3cc6c76840 --- /dev/null +++ b/Zend/tests/zpp/path_str_zpp_specifier_weak_mode.phpt @@ -0,0 +1,115 @@ +--TEST-- +Test path_str ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_path_str($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_str_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_str_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_str_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: + +Deprecated: zend_path_str(): Passing null to parameter #1 ($param) of type string is deprecated in %s on line %d +string(0) "" +NULL + +Deprecated: zend_path_str_slow_zpp(): Passing null to parameter #1 ($param) of type string is deprecated in %s on line %d +string(0) "" +NULL +Using false: +string(0) "" +string(0) "" +string(0) "" +string(0) "" +Using true: +string(1) "1" +string(1) "1" +string(1) "1" +string(1) "1" +Using 42: +string(2) "42" +string(2) "42" +string(2) "42" +string(2) "42" +Using 73.5: +string(4) "73.5" +string(4) "73.5" +string(4) "73.5" +string(4) "73.5" +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +ValueError: zend_path_str(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_or_null(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_slow_zpp(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must not contain any null bytes +Using []: +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, array given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, array given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, array given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, array given +Using new stdClass(): +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, stdClass given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, stdClass given +Using new S(): +string(7) "S class" +string(7) "S class" +string(7) "S class" +string(7) "S class" +Using STDOUT: +TypeError: zend_path_str(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_path_str_or_null(): Argument #1 ($param) must be of type ?string, resource given +TypeError: zend_path_str_slow_zpp(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, resource given +Using "foo\0bar": +ValueError: zend_path_str(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_or_null(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_slow_zpp(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_str_or_null_slow_zpp(): Argument #1 ($param) must not contain any null bytes diff --git a/Zend/tests/zpp/path_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/path_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..d51819cc6b99 --- /dev/null +++ b/Zend/tests/zpp/path_zpp_specifier_strict_mode.phpt @@ -0,0 +1,113 @@ +--TEST-- +Test path ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_path($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Using null: +TypeError: zend_path(): Argument #1 ($param) must be of type string, null given +NULL +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, null given +NULL +Using false: +TypeError: zend_path(): Argument #1 ($param) must be of type string, false given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, false given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, false given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, false given +Using true: +TypeError: zend_path(): Argument #1 ($param) must be of type string, true given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, true given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, true given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, true given +Using 42: +TypeError: zend_path(): Argument #1 ($param) must be of type string, int given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, int given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, int given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, int given +Using 73.5: +TypeError: zend_path(): Argument #1 ($param) must be of type string, float given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, float given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, float given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, float given +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +ValueError: zend_path(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_or_null(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_slow_zpp(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must not contain any null bytes +Using []: +TypeError: zend_path(): Argument #1 ($param) must be of type string, array given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, array given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, array given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, array given +Using new stdClass(): +TypeError: zend_path(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, stdClass given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, stdClass given +Using new S(): +TypeError: zend_path(): Argument #1 ($param) must be of type string, S given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, S given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, S given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, S given +Using STDOUT: +TypeError: zend_path(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, resource given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, resource given +Using "foo\0bar": +ValueError: zend_path(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_or_null(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_slow_zpp(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must not contain any null bytes diff --git a/Zend/tests/zpp/path_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/path_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..940531ebdb1d --- /dev/null +++ b/Zend/tests/zpp/path_zpp_specifier_weak_mode.phpt @@ -0,0 +1,115 @@ +--TEST-- +Test path ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_path($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_path_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: + +Deprecated: zend_path(): Passing null to parameter #1 ($param) of type string is deprecated in %s on line %d +string(0) "" +NULL + +Deprecated: zend_path_slow_zpp(): Passing null to parameter #1 ($param) of type string is deprecated in %s on line %d +string(0) "" +NULL +Using false: +string(0) "" +string(0) "" +string(0) "" +string(0) "" +Using true: +string(1) "1" +string(1) "1" +string(1) "1" +string(1) "1" +Using 42: +string(2) "42" +string(2) "42" +string(2) "42" +string(2) "42" +Using 73.5: +string(4) "73.5" +string(4) "73.5" +string(4) "73.5" +string(4) "73.5" +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +ValueError: zend_path(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_or_null(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_slow_zpp(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must not contain any null bytes +Using []: +TypeError: zend_path(): Argument #1 ($param) must be of type string, array given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, array given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, array given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, array given +Using new stdClass(): +TypeError: zend_path(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, stdClass given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, stdClass given +Using new S(): +string(7) "S class" +string(7) "S class" +string(7) "S class" +string(7) "S class" +Using STDOUT: +TypeError: zend_path(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_path_or_null(): Argument #1 ($param) must be of type ?string, resource given +TypeError: zend_path_slow_zpp(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, resource given +Using "foo\0bar": +ValueError: zend_path(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_or_null(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_slow_zpp(): Argument #1 ($param) must not contain any null bytes +ValueError: zend_path_or_null_slow_zpp(): Argument #1 ($param) must not contain any null bytes diff --git a/Zend/tests/zpp/str_or_long_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/str_or_long_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..18c6c07df132 --- /dev/null +++ b/Zend/tests/zpp/str_or_long_zpp_specifier_strict_mode.phpt @@ -0,0 +1,69 @@ +--TEST-- +Test str_or_long ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_str_or_long($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_str_or_long_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, null given +NULL +Using false: +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, false given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, false given +Using true: +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, true given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, true given +Using 42: +int(42) +int(42) +Using 73.5: +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, float given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, float given +Using 'string': +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, array given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, array given +Using new stdClass(): +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, stdClass given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, stdClass given +Using new S(): +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, S given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, S given +Using STDOUT: +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, resource given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, resource given diff --git a/Zend/tests/zpp/str_or_long_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/str_or_long_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..e68de39eaf50 --- /dev/null +++ b/Zend/tests/zpp/str_or_long_zpp_specifier_weak_mode.phpt @@ -0,0 +1,73 @@ +--TEST-- +Test str_or_long ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_str_or_long($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_str_or_long_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: + +Deprecated: zend_str_or_long(): Passing null to parameter #1 ($param) of type string|int is deprecated in %s on line %d +int(0) +NULL +Using false: +int(0) +int(0) +Using true: +int(1) +int(1) +Using 42: +int(42) +int(42) +Using 73.5: + +Deprecated: Implicit conversion from float 73.5 to int loses precision in %s on line %d +int(73) + +Deprecated: Implicit conversion from float 73.5 to int loses precision in %s on line %d +int(73) +Using 'string': +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, array given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, array given +Using new stdClass(): +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, stdClass given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, stdClass given +Using new S(): +string(7) "S class" +string(7) "S class" +Using STDOUT: +TypeError: zend_str_or_long(): Argument #1 ($param) must be of type string|int, resource given +TypeError: zend_str_or_long_or_null(): Argument #1 ($param) must be of type string|int|null, resource given diff --git a/Zend/tests/zpp/str_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/str_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..7aa5ca746033 --- /dev/null +++ b/Zend/tests/zpp/str_zpp_specifier_strict_mode.phpt @@ -0,0 +1,107 @@ +--TEST-- +Test str ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_str($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_str_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_str_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_str_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: +TypeError: zend_str(): Argument #1 ($param) must be of type string, null given +NULL +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, null given +NULL +Using false: +TypeError: zend_str(): Argument #1 ($param) must be of type string, false given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, false given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, false given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, false given +Using true: +TypeError: zend_str(): Argument #1 ($param) must be of type string, true given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, true given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, true given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, true given +Using 42: +TypeError: zend_str(): Argument #1 ($param) must be of type string, int given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, int given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, int given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, int given +Using 73.5: +TypeError: zend_str(): Argument #1 ($param) must be of type string, float given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, float given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, float given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, float given +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +TypeError: zend_str(): Argument #1 ($param) must be of type string, array given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, array given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, array given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, array given +Using new stdClass(): +TypeError: zend_str(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, stdClass given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, stdClass given +Using new S(): +TypeError: zend_str(): Argument #1 ($param) must be of type string, S given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, S given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, S given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, S given +Using STDOUT: +TypeError: zend_str(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, resource given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, resource given diff --git a/Zend/tests/zpp/str_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/str_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..7c1a87053c30 --- /dev/null +++ b/Zend/tests/zpp/str_zpp_specifier_weak_mode.phpt @@ -0,0 +1,109 @@ +--TEST-- +Test str ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_str($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_str_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_str_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_str_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: + +Deprecated: zend_str(): Passing null to parameter #1 ($param) of type string is deprecated in %s on line %d +string(0) "" +NULL + +Deprecated: zend_str_slow_zpp(): Passing null to parameter #1 ($param) of type string is deprecated in %s on line %d +string(0) "" +NULL +Using false: +string(0) "" +string(0) "" +string(0) "" +string(0) "" +Using true: +string(1) "1" +string(1) "1" +string(1) "1" +string(1) "1" +Using 42: +string(2) "42" +string(2) "42" +string(2) "42" +string(2) "42" +Using 73.5: +string(4) "73.5" +string(4) "73.5" +string(4) "73.5" +string(4) "73.5" +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +TypeError: zend_str(): Argument #1 ($param) must be of type string, array given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, array given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, array given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, array given +Using new stdClass(): +TypeError: zend_str(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, stdClass given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, stdClass given +Using new S(): +string(7) "S class" +string(7) "S class" +string(7) "S class" +string(7) "S class" +Using STDOUT: +TypeError: zend_str(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_str_or_null(): Argument #1 ($param) must be of type ?string, resource given +TypeError: zend_str_slow_zpp(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_str_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, resource given diff --git a/Zend/tests/zpp/string_param_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/string_param_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..1a0c38a9a2b1 --- /dev/null +++ b/Zend/tests/zpp/string_param_zpp_specifier_strict_mode.phpt @@ -0,0 +1,107 @@ +--TEST-- +Test string_param ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_string_param($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_string_param_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_string_param_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_string_param_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, null given +NULL +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, null given +NULL +Using false: +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, false given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, false given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, false given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, false given +Using true: +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, true given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, true given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, true given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, true given +Using 42: +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, int given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, int given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, int given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, int given +Using 73.5: +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, float given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, float given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, float given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, float given +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, array given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, array given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, array given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, array given +Using new stdClass(): +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, stdClass given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, stdClass given +Using new S(): +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, S given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, S given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, S given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, S given +Using STDOUT: +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, resource given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, resource given diff --git a/Zend/tests/zpp/string_param_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/string_param_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..d5d62d046906 --- /dev/null +++ b/Zend/tests/zpp/string_param_zpp_specifier_weak_mode.phpt @@ -0,0 +1,109 @@ +--TEST-- +Test string_param ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_string_param($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_string_param_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_string_param_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_string_param_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: + +Deprecated: zend_string_param(): Passing null to parameter #1 ($param) of type string is deprecated in %s on line %d +string(0) "" +NULL + +Deprecated: zend_string_param_slow_zpp(): Passing null to parameter #1 ($param) of type string is deprecated in %s on line %d +string(0) "" +NULL +Using false: +string(0) "" +string(0) "" +string(0) "" +string(0) "" +Using true: +string(1) "1" +string(1) "1" +string(1) "1" +string(1) "1" +Using 42: +string(2) "42" +string(2) "42" +string(2) "42" +string(2) "42" +Using 73.5: +string(4) "73.5" +string(4) "73.5" +string(4) "73.5" +string(4) "73.5" +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, array given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, array given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, array given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, array given +Using new stdClass(): +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, stdClass given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, stdClass given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, stdClass given +Using new S(): +string(7) "S class" +string(7) "S class" +string(7) "S class" +string(7) "S class" +Using STDOUT: +TypeError: zend_string_param(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_string_param_or_null(): Argument #1 ($param) must be of type ?string, resource given +TypeError: zend_string_param_slow_zpp(): Argument #1 ($param) must be of type string, resource given +TypeError: zend_string_param_or_null_slow_zpp(): Argument #1 ($param) must be of type ?string, resource given diff --git a/Zend/tests/zpp/variadic_zpp_specifier.phpt b/Zend/tests/zpp/variadic_zpp_specifier.phpt new file mode 100644 index 000000000000..746483de89a5 --- /dev/null +++ b/Zend/tests/zpp/variadic_zpp_specifier.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test variadic ZPP specifiers +--EXTENSIONS-- +zend_test +--FILE-- +getMessage(), "\n"; +} + +?> +--EXPECT-- +array(0) { +} +array(3) { + [0]=> + int(1) + [1]=> + string(3) "foo" + [2]=> + array(2) { + [0]=> + int(1) + [1]=> + int(2) + } +} +array(0) { +} +array(3) { + [0]=> + int(1) + [1]=> + string(3) "foo" + [2]=> + array(2) { + [0]=> + int(1) + [1]=> + int(2) + } +} +array(3) { + [0]=> + int(1) + [1]=> + string(3) "foo" + ["b"]=> + string(3) "bar" +} +ArgumentCountError: Internal function zend_variadic() does not accept named variadic arguments diff --git a/Zend/tests/zpp/zval_zpp_specifier_strict_mode.phpt b/Zend/tests/zpp/zval_zpp_specifier_strict_mode.phpt new file mode 100644 index 000000000000..26b4313be98b --- /dev/null +++ b/Zend/tests/zpp/zval_zpp_specifier_strict_mode.phpt @@ -0,0 +1,164 @@ +--TEST-- +Test zval ZPP specifier (strict_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_zval($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_zval_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_zval_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_zval_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_zval_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_zval_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: +NULL +NULL +NULL +NULL +NULL +NULL +Using false: +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +Using true: +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +Using 42: +int(42) +int(42) +int(42) +int(42) +int(42) +int(42) +Using 73.5: +float(73.5) +float(73.5) +float(73.5) +float(73.5) +float(73.5) +float(73.5) +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +Using new S(): +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +Using STDOUT: +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) diff --git a/Zend/tests/zpp/zval_zpp_specifier_weak_mode.phpt b/Zend/tests/zpp/zval_zpp_specifier_weak_mode.phpt new file mode 100644 index 000000000000..048d236a19c1 --- /dev/null +++ b/Zend/tests/zpp/zval_zpp_specifier_weak_mode.phpt @@ -0,0 +1,162 @@ +--TEST-- +Test zval ZPP specifier (weak_mode) +--EXTENSIONS-- +zend_test +--FILE-- + $type) { + echo "Using $name:\n"; + try { + var_dump(zend_zval($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_zval_or_null($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_zval_separate($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_zval_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + try { + var_dump(zend_zval_or_null_slow_zpp($type)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } + $ref =& $type; + try { + var_dump(zend_zval_deref_separate($ref)); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} + +?> +--EXPECTF-- +Using null: +NULL +NULL +NULL +NULL +NULL +NULL +Using false: +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +Using true: +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +Using 42: +int(42) +int(42) +int(42) +int(42) +int(42) +int(42) +Using 73.5: +float(73.5) +float(73.5) +float(73.5) +float(73.5) +float(73.5) +float(73.5) +Using 'string': +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +string(6) "string" +Using '15': +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +string(2) "15" +Using '56.7': +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +string(4) "56.7" +Using 'stdClass': +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +string(8) "stdClass" +Using anon class name: +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +string(%d) "class@anonymous%s" +Using []: +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +Using new stdClass(): +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +object(stdClass)#%d (0) { +} +Using new S(): +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +object(S)#%d (0) { +} +Using STDOUT: +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (stream) diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 82bfa8d38e33..4a11d3dbb263 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -890,6 +890,861 @@ static const zend_function_entry ext_function_legacy[] = { ZEND_FE(zend_iterable_legacy, arginfo_zend_iterable_legacy) ZEND_FE_END }; +/* Tests Z_PARAM_ENUM */ +static ZEND_FUNCTION(zend_enum) +{ + zend_long case_id; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ENUM(case_id, zend_test_unit_enum) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_LONG(case_id); +} + +/* Tests Z_PARAM_ARRAY specifiers */ +static ZEND_FUNCTION(zend_array) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(zv) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_array_or_null) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_OR_NULL(zv) + ZEND_PARSE_PARAMETERS_END(); + + if (!zv) { + RETURN_NULL(); + } + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_array_separate) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_EX(zv, 0, 1) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_array_deref_separate) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_EX2(zv, 0, 1, 1) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_array_slow_zpp) +{ + zval *zv; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &zv) == FAILURE) { + RETURN_THROWS(); + } + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_array_or_null_slow_zpp) +{ + zval *zv; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a!", &zv) == FAILURE) { + RETURN_THROWS(); + } + + if (!zv) { + RETURN_NULL(); + } + RETURN_COPY(zv); +} + +/* Tests Z_PARAM_ARRAY_OR_OBJECT specifiers */ +static ZEND_FUNCTION(zend_array_or_object) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_OR_OBJECT(zv) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_array_or_object_separate) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_OR_OBJECT_EX(zv, 0, 1) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_array_or_object_deref_separate) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_OR_OBJECT_EX2(zv, 0, 1, 1) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_array_or_object_slow_zpp) +{ + zval *zv; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "A", &zv) == FAILURE) { + RETURN_THROWS(); + } + + RETURN_COPY(zv); +} + +/* Tests Z_PARAM_ARRAY_HT specifiers */ +static ZEND_FUNCTION(zend_array_ht) +{ + HashTable *ht; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_HT(ht) + ZEND_PARSE_PARAMETERS_END(); + + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +static ZEND_FUNCTION(zend_array_ht_or_null) +{ + HashTable *ht; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_HT_OR_NULL(ht) + ZEND_PARSE_PARAMETERS_END(); + + if (!ht) { + RETURN_NULL(); + } + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +static ZEND_FUNCTION(zend_array_ht_separate) +{ + HashTable *ht; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_HT_EX(ht, 0, 1) + ZEND_PARSE_PARAMETERS_END(); + + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +static ZEND_FUNCTION(zend_array_ht_deref_separate) +{ + HashTable *ht; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_HT_EX2(ht, 0, 1, 1) + ZEND_PARSE_PARAMETERS_END(); + + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +static ZEND_FUNCTION(zend_array_ht_slow_zpp) +{ + HashTable *ht; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "h", &ht) == FAILURE) { + RETURN_THROWS(); + } + + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +static ZEND_FUNCTION(zend_array_ht_or_null_slow_zpp) +{ + HashTable *ht; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "h!", &ht) == FAILURE) { + RETURN_THROWS(); + } + + if (!ht) { + RETURN_NULL(); + } + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +/* Tests Z_PARAM_ARRAY_HT_OR_LONG specifiers */ +static ZEND_FUNCTION(zend_array_ht_or_long) +{ + HashTable *ht = NULL; + zend_long l = 0; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_HT_OR_LONG(ht, l) + ZEND_PARSE_PARAMETERS_END(); + + if (ht) { + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); + } + RETURN_LONG(l); +} + +static ZEND_FUNCTION(zend_array_ht_or_long_or_null) +{ + HashTable *ht = NULL; + zend_long l = 0; + bool is_null = 0; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_HT_OR_LONG_OR_NULL(ht, l, is_null) + ZEND_PARSE_PARAMETERS_END(); + + if (is_null) { + RETURN_NULL(); + } + if (ht) { + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); + } + RETURN_LONG(l); +} + +/* Tests Z_PARAM_ARRAY_HT_OR_STR specifiers */ +static ZEND_FUNCTION(zend_array_ht_or_str) +{ + HashTable *ht = NULL; + zend_string *str = NULL; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_HT_OR_STR(ht, str) + ZEND_PARSE_PARAMETERS_END(); + + if (ht) { + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); + } + RETURN_STR_COPY(str); +} + +static ZEND_FUNCTION(zend_array_ht_or_str_or_null) +{ + HashTable *ht = NULL; + zend_string *str = NULL; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(ht, str) + ZEND_PARSE_PARAMETERS_END(); + + if (ht) { + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); + } else if (str) { + RETURN_STR_COPY(str); + } + RETURN_NULL(); +} + +/* Tests Z_PARAM_ARRAY_OR_OBJECT_HT specifiers */ +static ZEND_FUNCTION(zend_array_or_object_ht) +{ + HashTable *ht; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_OR_OBJECT_HT(ht) + ZEND_PARSE_PARAMETERS_END(); + + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +static ZEND_FUNCTION(zend_array_or_object_ht_separate) +{ + HashTable *ht; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_OR_OBJECT_HT_EX(ht, 0, 1) + ZEND_PARSE_PARAMETERS_END(); + + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +static ZEND_FUNCTION(zend_array_or_object_ht_deref_separate) +{ + HashTable *ht; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_OR_OBJECT_HT_EX2(ht, 0, 1, 1) + ZEND_PARSE_PARAMETERS_END(); + + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +static ZEND_FUNCTION(zend_array_or_object_ht_slow_zpp) +{ + HashTable *ht; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "H", &ht) == FAILURE) { + RETURN_THROWS(); + } + + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + RETURN_EMPTY_ARRAY(); + } + GC_ADDREF(ht); + RETURN_ARR(ht); +} + +/* Tests Z_PARAM_FUNC specifiers */ +static ZEND_FUNCTION(zend_func) +{ + zend_fcall_info fci; + zend_fcall_info_cache fcc; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_FUNC(fci, fcc) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_STR_COPY(fcc.function_handler->common.function_name); +} + +static ZEND_FUNCTION(zend_func_or_null) +{ + zend_fcall_info fci; + zend_fcall_info_cache fcc; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_FUNC_OR_NULL(fci, fcc) + ZEND_PARSE_PARAMETERS_END(); + + if (!ZEND_FCC_INITIALIZED(fcc)) { + RETURN_NULL(); + } + + RETURN_STR_COPY(fcc.function_handler->common.function_name); +} + +static ZEND_FUNCTION(zend_func_no_trampoline_free) +{ + zend_fcall_info fci; + zend_fcall_info_cache fcc; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_FUNC_NO_TRAMPOLINE_FREE(fci, fcc) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_STR_COPY(fcc.function_handler->common.function_name); +} + +static ZEND_FUNCTION(zend_func_no_trampoline_free_or_null) +{ + zend_fcall_info fci; + zend_fcall_info_cache fcc; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_FUNC_NO_TRAMPOLINE_FREE_OR_NULL(fci, fcc) + ZEND_PARSE_PARAMETERS_END(); + + if (!ZEND_FCC_INITIALIZED(fcc)) { + RETURN_NULL(); + } + + RETURN_STR_COPY(fcc.function_handler->common.function_name); +} + +static ZEND_FUNCTION(zend_func_slow_zpp) +{ + zend_fcall_info fci; + zend_fcall_info_cache fcc; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "f", &fci, &fcc) == FAILURE) { + RETURN_THROWS(); + } + + RETURN_STR_COPY(fcc.function_handler->common.function_name); +} + +static ZEND_FUNCTION(zend_func_or_null_slow_zpp) +{ + zend_fcall_info fci; + zend_fcall_info_cache fcc; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!", &fci, &fcc) == FAILURE) { + RETURN_THROWS(); + } + + if (!ZEND_FCC_INITIALIZED(fcc)) { + RETURN_NULL(); + } + + RETURN_STR_COPY(fcc.function_handler->common.function_name); +} + +/* Tests Z_PARAM_PATH specifiers */ +static ZEND_FUNCTION(zend_path) +{ + char *path; + size_t path_len; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_PATH(path, path_len) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_STRINGL(path, path_len); +} + +static ZEND_FUNCTION(zend_path_or_null) +{ + char *path; + size_t path_len; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_PATH_OR_NULL(path, path_len) + ZEND_PARSE_PARAMETERS_END(); + + if (!path) { + RETURN_NULL(); + } + + RETURN_STRINGL(path, path_len); +} + +static ZEND_FUNCTION(zend_path_slow_zpp) +{ + char *path; + size_t path_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &path, &path_len) == FAILURE) { + RETURN_THROWS(); + } + + RETURN_STRINGL(path, path_len); +} + +static ZEND_FUNCTION(zend_path_or_null_slow_zpp) +{ + char *path; + size_t path_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p!", &path, &path_len) == FAILURE) { + RETURN_THROWS(); + } + + if (!path) { + RETURN_NULL(); + } + + RETURN_STRINGL(path, path_len); +} + +/* Tests Z_PARAM_PATH_STR specifiers */ +static ZEND_FUNCTION(zend_path_str) +{ + zend_string *path; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_PATH_STR(path) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_STR_COPY(path); +} + +static ZEND_FUNCTION(zend_path_str_or_null) +{ + zend_string *path; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_PATH_STR_OR_NULL(path) + ZEND_PARSE_PARAMETERS_END(); + + if (!path) { + RETURN_NULL(); + } + + RETURN_STR_COPY(path); +} + +static ZEND_FUNCTION(zend_path_str_slow_zpp) +{ + zend_string *path; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "P", &path) == FAILURE) { + RETURN_THROWS(); + } + + RETURN_STR_COPY(path); +} + +static ZEND_FUNCTION(zend_path_str_or_null_slow_zpp) +{ + zend_string *path; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "P!", &path) == FAILURE) { + RETURN_THROWS(); + } + + if (!path) { + RETURN_NULL(); + } + + RETURN_STR_COPY(path); +} + +/* Tests Z_PARAM_STRING specifiers */ +static ZEND_FUNCTION(zend_string_param) +{ + char *str; + size_t str_len; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STRING(str, str_len) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_STRINGL(str, str_len); +} + +static ZEND_FUNCTION(zend_string_param_or_null) +{ + char *str; + size_t str_len; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STRING_OR_NULL(str, str_len) + ZEND_PARSE_PARAMETERS_END(); + + if (!str) { + RETURN_NULL(); + } + + RETURN_STRINGL(str, str_len); +} + +static ZEND_FUNCTION(zend_string_param_slow_zpp) +{ + char *str; + size_t str_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { + RETURN_THROWS(); + } + + RETURN_STRINGL(str, str_len); +} + +static ZEND_FUNCTION(zend_string_param_or_null_slow_zpp) +{ + char *str; + size_t str_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", &str, &str_len) == FAILURE) { + RETURN_THROWS(); + } + + if (!str) { + RETURN_NULL(); + } + + RETURN_STRINGL(str, str_len); +} + +/* Tests Z_PARAM_STR specifiers */ +static ZEND_FUNCTION(zend_str) +{ + zend_string *str; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(str) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_STR_COPY(str); +} + +static ZEND_FUNCTION(zend_str_or_null) +{ + zend_string *str; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR_OR_NULL(str) + ZEND_PARSE_PARAMETERS_END(); + + if (!str) { + RETURN_NULL(); + } + + RETURN_STR_COPY(str); +} + +static ZEND_FUNCTION(zend_str_slow_zpp) +{ + zend_string *str; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { + RETURN_THROWS(); + } + + RETURN_STR_COPY(str); +} + +static ZEND_FUNCTION(zend_str_or_null_slow_zpp) +{ + zend_string *str; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S!", &str) == FAILURE) { + RETURN_THROWS(); + } + + if (!str) { + RETURN_NULL(); + } + + RETURN_STR_COPY(str); +} + +/* Tests Z_PARAM_STR_OR_LONG specifiers */ +static ZEND_FUNCTION(zend_str_or_long) +{ + zend_string *str = NULL; + zend_long l = 0; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR_OR_LONG(str, l) + ZEND_PARSE_PARAMETERS_END(); + + if (str) { + RETURN_STR_COPY(str); + } + RETURN_LONG(l); +} + +static ZEND_FUNCTION(zend_str_or_long_or_null) +{ + zend_string *str = NULL; + zend_long l = 0; + bool is_null = 0; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR_OR_LONG_OR_NULL(str, l, is_null) + ZEND_PARSE_PARAMETERS_END(); + + if (is_null) { + RETURN_NULL(); + } + if (str) { + RETURN_STR_COPY(str); + } + RETURN_LONG(l); +} + +/* Tests Z_PARAM_ZVAL specifiers */ +static ZEND_FUNCTION(zend_zval) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(zv) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_zval_or_null) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL_OR_NULL(zv) + ZEND_PARSE_PARAMETERS_END(); + + if (!zv) { + RETURN_NULL(); + } + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_zval_separate) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL_EX(zv, 0, 1) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_zval_deref_separate) +{ + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL_EX2(zv, 0, 1, 1) + ZEND_PARSE_PARAMETERS_END(); + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_zval_slow_zpp) +{ + zval *zv; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zv) == FAILURE) { + RETURN_THROWS(); + } + + RETURN_COPY(zv); +} + +static ZEND_FUNCTION(zend_zval_or_null_slow_zpp) +{ + zval *zv; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z!", &zv) == FAILURE) { + RETURN_THROWS(); + } + + if (!zv) { + RETURN_NULL(); + } + + RETURN_COPY(zv); +} + +/* Tests Z_PARAM_VARIADIC specifiers */ +static ZEND_FUNCTION(zend_variadic) +{ + zval *args; + uint32_t num_args; + + ZEND_PARSE_PARAMETERS_START(0, -1) + Z_PARAM_VARIADIC('*', args, num_args) + ZEND_PARSE_PARAMETERS_END(); + + array_init(return_value); + for (uint32_t i = 0; i < num_args; i++) { + add_next_index_zval(return_value, &args[i]); + if (Z_REFCOUNTED(args[i])) { + GC_TRY_ADDREF(Z_COUNTED(args[i])); + } + } +} + +static ZEND_FUNCTION(zend_variadic_with_named) +{ + zval *args; + uint32_t num_args; + HashTable *named; + + ZEND_PARSE_PARAMETERS_START(0, -1) + Z_PARAM_VARIADIC_WITH_NAMED(args, num_args, named) + ZEND_PARSE_PARAMETERS_END(); + + array_init(return_value); + for (uint32_t i = 0; i < num_args; i++) { + add_next_index_zval(return_value, &args[i]); + if (Z_REFCOUNTED(args[i])) { + GC_TRY_ADDREF(Z_COUNTED(args[i])); + } + } + if (named) { + zend_string *name; + zval *val; + ZEND_HASH_FOREACH_STR_KEY_VAL(named, name, val) { + if (name) { + add_assoc_zval_ex(return_value, ZSTR_VAL(name), ZSTR_LEN(name), val); + if (Z_REFCOUNTED_P(val)) { + GC_TRY_ADDREF(Z_COUNTED_P(val)); + } + } + } ZEND_HASH_FOREACH_END(); + } +} + +static ZEND_FUNCTION(zend_variadic_slow_zpp) +{ + zval *args = NULL; + uint32_t num_args = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &args, &num_args) == FAILURE) { + RETURN_THROWS(); + } + + array_init(return_value); + for (uint32_t i = 0; i < num_args; i++) { + add_next_index_zval(return_value, &args[i]); + if (Z_REFCOUNTED(args[i])) { + GC_TRY_ADDREF(Z_COUNTED(args[i])); + } + } +} + /* END ZPP test functions */ static ZEND_FUNCTION(zend_test_compile_string) diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index 3c09668bddb1..c2ed31a4c0ac 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -378,6 +378,80 @@ function zend_number_or_string(string|int|float $param): string|int|float {} function zend_number_or_string_or_null(string|int|float|null $param): string|int|float|null {} + function zend_enum(ZendTestUnitEnum $param): int {} + + function zend_array(array $param): array {} + function zend_array_or_null(?array $param): ?array {} + function zend_array_separate(array $param): array {} + function zend_array_deref_separate(array &$param): array {} + function zend_array_slow_zpp(array $param): array {} + function zend_array_or_null_slow_zpp(?array $param): ?array {} + + function zend_array_or_object(array|object $param): array|object {} + function zend_array_or_object_separate(array|object $param): array|object {} + function zend_array_or_object_deref_separate(array|object &$param): array|object {} + function zend_array_or_object_slow_zpp(array|object $param): array|object {} + + function zend_array_ht(array $param): array {} + function zend_array_ht_or_null(?array $param): ?array {} + function zend_array_ht_separate(array $param): array {} + function zend_array_ht_deref_separate(array &$param): array {} + function zend_array_ht_slow_zpp(array $param): array {} + function zend_array_ht_or_null_slow_zpp(?array $param): ?array {} + + function zend_array_ht_or_long(array|int $param): array|int {} + function zend_array_ht_or_long_or_null(array|int|null $param): array|int|null {} + + function zend_array_ht_or_str(array|string $param): array|string {} + function zend_array_ht_or_str_or_null(array|string|null $param): array|string|null {} + + function zend_array_or_object_ht(array|object $param): array {} + function zend_array_or_object_ht_separate(array|object $param): array {} + function zend_array_or_object_ht_deref_separate(array|object &$param): array {} + function zend_array_or_object_ht_slow_zpp(array|object $param): array {} + + function zend_func(callable $param): string {} + function zend_func_or_null(?callable $param): ?string {} + function zend_func_no_trampoline_free(callable $param): string {} + function zend_func_no_trampoline_free_or_null(?callable $param): ?string {} + function zend_func_slow_zpp(callable $param): string {} + function zend_func_or_null_slow_zpp(?callable $param): ?string {} + + function zend_path(string $param): string {} + function zend_path_or_null(?string $param): ?string {} + function zend_path_slow_zpp(string $param): string {} + function zend_path_or_null_slow_zpp(?string $param): ?string {} + + function zend_path_str(string $param): string {} + function zend_path_str_or_null(?string $param): ?string {} + function zend_path_str_slow_zpp(string $param): string {} + function zend_path_str_or_null_slow_zpp(?string $param): ?string {} + + function zend_string_param(string $param): string {} + function zend_string_param_or_null(?string $param): ?string {} + function zend_string_param_slow_zpp(string $param): string {} + function zend_string_param_or_null_slow_zpp(?string $param): ?string {} + + function zend_str(string $param): string {} + function zend_str_or_null(?string $param): ?string {} + function zend_str_slow_zpp(string $param): string {} + function zend_str_or_null_slow_zpp(?string $param): ?string {} + + function zend_str_or_long(string|int $param): string|int {} + function zend_str_or_long_or_null(string|int|null $param): string|int|null {} + + function zend_zval(mixed $param): mixed {} + function zend_zval_or_null(mixed $param): mixed {} + function zend_zval_separate(mixed $param): mixed {} + function zend_zval_deref_separate(mixed &$param): mixed {} + function zend_zval_slow_zpp(mixed $param): mixed {} + function zend_zval_or_null_slow_zpp(mixed $param): mixed {} + + function zend_variadic(mixed ...$args): array {} + function zend_variadic_with_named(mixed ...$args): array {} + function zend_variadic_slow_zpp(mixed ...$args): array {} + + function zend_iterable(iterable $arg1, ?iterable $arg2 = null): void {} function zend_weakmap_attach(object $object, mixed $value): bool {} diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index 93fdadb7f6b2..b08e9c85129b 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 4d728e740122add9d4c91f5c1abb5f5017690636 + * Stub hash: 8e10a86b1ea68cbbce5dbe775078c766275a69a8 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, IS_NEVER, 0) @@ -195,6 +195,160 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zend_number_or_string_or_null, 0 ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_NULL, NULL) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_enum, 0, 1, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, param, ZendTestUnitEnum, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_array, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, param, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_array_or_null, 0, 1, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(0, param, IS_ARRAY, 1) +ZEND_END_ARG_INFO() + +#define arginfo_zend_array_separate arginfo_zend_array + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_array_deref_separate, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(1, param, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_zend_array_slow_zpp arginfo_zend_array + +#define arginfo_zend_array_or_null_slow_zpp arginfo_zend_array_or_null + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zend_array_or_object, 0, 1, MAY_BE_ARRAY|MAY_BE_OBJECT) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_zend_array_or_object_separate arginfo_zend_array_or_object + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zend_array_or_object_deref_separate, 0, 1, MAY_BE_ARRAY|MAY_BE_OBJECT) + ZEND_ARG_TYPE_MASK(1, param, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_zend_array_or_object_slow_zpp arginfo_zend_array_or_object + +#define arginfo_zend_array_ht arginfo_zend_array + +#define arginfo_zend_array_ht_or_null arginfo_zend_array_or_null + +#define arginfo_zend_array_ht_separate arginfo_zend_array + +#define arginfo_zend_array_ht_deref_separate arginfo_zend_array_deref_separate + +#define arginfo_zend_array_ht_slow_zpp arginfo_zend_array + +#define arginfo_zend_array_ht_or_null_slow_zpp arginfo_zend_array_or_null + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zend_array_ht_or_long, 0, 1, MAY_BE_ARRAY|MAY_BE_LONG) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_ARRAY|MAY_BE_LONG, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zend_array_ht_or_long_or_null, 0, 1, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_NULL) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_NULL, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zend_array_ht_or_str, 0, 1, MAY_BE_ARRAY|MAY_BE_STRING) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_ARRAY|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zend_array_ht_or_str_or_null, 0, 1, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_array_or_object_ht, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_zend_array_or_object_ht_separate arginfo_zend_array_or_object_ht + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_array_or_object_ht_deref_separate, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_MASK(1, param, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_zend_array_or_object_ht_slow_zpp arginfo_zend_array_or_object_ht + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_func, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, param, IS_CALLABLE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_func_or_null, 0, 1, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, param, IS_CALLABLE, 1) +ZEND_END_ARG_INFO() + +#define arginfo_zend_func_no_trampoline_free arginfo_zend_func + +#define arginfo_zend_func_no_trampoline_free_or_null arginfo_zend_func_or_null + +#define arginfo_zend_func_slow_zpp arginfo_zend_func + +#define arginfo_zend_func_or_null_slow_zpp arginfo_zend_func_or_null + +#define arginfo_zend_path arginfo_zend_class_name + +#define arginfo_zend_path_or_null arginfo_zend_class_name_or_null + +#define arginfo_zend_path_slow_zpp arginfo_zend_class_name + +#define arginfo_zend_path_or_null_slow_zpp arginfo_zend_class_name_or_null + +#define arginfo_zend_path_str arginfo_zend_class_name + +#define arginfo_zend_path_str_or_null arginfo_zend_class_name_or_null + +#define arginfo_zend_path_str_slow_zpp arginfo_zend_class_name + +#define arginfo_zend_path_str_or_null_slow_zpp arginfo_zend_class_name_or_null + +#define arginfo_zend_string_param arginfo_zend_class_name + +#define arginfo_zend_string_param_or_null arginfo_zend_class_name_or_null + +#define arginfo_zend_string_param_slow_zpp arginfo_zend_class_name + +#define arginfo_zend_string_param_or_null_slow_zpp arginfo_zend_class_name_or_null + +#define arginfo_zend_str arginfo_zend_class_name + +#define arginfo_zend_str_or_null arginfo_zend_class_name_or_null + +#define arginfo_zend_str_slow_zpp arginfo_zend_class_name + +#define arginfo_zend_str_or_null_slow_zpp arginfo_zend_class_name_or_null + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zend_str_or_long, 0, 1, MAY_BE_STRING|MAY_BE_LONG) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_zend_str_or_long_or_null, 0, 1, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_zval, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, param, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_zend_zval_or_null arginfo_zend_zval + +#define arginfo_zend_zval_separate arginfo_zend_zval + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_zval_deref_separate, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(1, param, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_zend_zval_slow_zpp arginfo_zend_zval + +#define arginfo_zend_zval_or_null_slow_zpp arginfo_zend_zval + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_variadic, 0, 0, IS_ARRAY, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_zend_variadic_with_named arginfo_zend_variadic + +#define arginfo_zend_variadic_slow_zpp arginfo_zend_variadic + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_iterable, 0, 1, IS_VOID, 0) ZEND_ARG_OBJ_TYPE_MASK(0, arg1, Traversable, MAY_BE_ARRAY, NULL) ZEND_ARG_OBJ_TYPE_MASK(0, arg2, Traversable, MAY_BE_ARRAY|MAY_BE_NULL, "null") @@ -477,6 +631,64 @@ static ZEND_FUNCTION(zend_obj_stdclass_or_int); static ZEND_FUNCTION(zend_obj_stdclass_or_int_or_null); static ZEND_FUNCTION(zend_number_or_string); static ZEND_FUNCTION(zend_number_or_string_or_null); +static ZEND_FUNCTION(zend_enum); +static ZEND_FUNCTION(zend_array); +static ZEND_FUNCTION(zend_array_or_null); +static ZEND_FUNCTION(zend_array_separate); +static ZEND_FUNCTION(zend_array_deref_separate); +static ZEND_FUNCTION(zend_array_slow_zpp); +static ZEND_FUNCTION(zend_array_or_null_slow_zpp); +static ZEND_FUNCTION(zend_array_or_object); +static ZEND_FUNCTION(zend_array_or_object_separate); +static ZEND_FUNCTION(zend_array_or_object_deref_separate); +static ZEND_FUNCTION(zend_array_or_object_slow_zpp); +static ZEND_FUNCTION(zend_array_ht); +static ZEND_FUNCTION(zend_array_ht_or_null); +static ZEND_FUNCTION(zend_array_ht_separate); +static ZEND_FUNCTION(zend_array_ht_deref_separate); +static ZEND_FUNCTION(zend_array_ht_slow_zpp); +static ZEND_FUNCTION(zend_array_ht_or_null_slow_zpp); +static ZEND_FUNCTION(zend_array_ht_or_long); +static ZEND_FUNCTION(zend_array_ht_or_long_or_null); +static ZEND_FUNCTION(zend_array_ht_or_str); +static ZEND_FUNCTION(zend_array_ht_or_str_or_null); +static ZEND_FUNCTION(zend_array_or_object_ht); +static ZEND_FUNCTION(zend_array_or_object_ht_separate); +static ZEND_FUNCTION(zend_array_or_object_ht_deref_separate); +static ZEND_FUNCTION(zend_array_or_object_ht_slow_zpp); +static ZEND_FUNCTION(zend_func); +static ZEND_FUNCTION(zend_func_or_null); +static ZEND_FUNCTION(zend_func_no_trampoline_free); +static ZEND_FUNCTION(zend_func_no_trampoline_free_or_null); +static ZEND_FUNCTION(zend_func_slow_zpp); +static ZEND_FUNCTION(zend_func_or_null_slow_zpp); +static ZEND_FUNCTION(zend_path); +static ZEND_FUNCTION(zend_path_or_null); +static ZEND_FUNCTION(zend_path_slow_zpp); +static ZEND_FUNCTION(zend_path_or_null_slow_zpp); +static ZEND_FUNCTION(zend_path_str); +static ZEND_FUNCTION(zend_path_str_or_null); +static ZEND_FUNCTION(zend_path_str_slow_zpp); +static ZEND_FUNCTION(zend_path_str_or_null_slow_zpp); +static ZEND_FUNCTION(zend_string_param); +static ZEND_FUNCTION(zend_string_param_or_null); +static ZEND_FUNCTION(zend_string_param_slow_zpp); +static ZEND_FUNCTION(zend_string_param_or_null_slow_zpp); +static ZEND_FUNCTION(zend_str); +static ZEND_FUNCTION(zend_str_or_null); +static ZEND_FUNCTION(zend_str_slow_zpp); +static ZEND_FUNCTION(zend_str_or_null_slow_zpp); +static ZEND_FUNCTION(zend_str_or_long); +static ZEND_FUNCTION(zend_str_or_long_or_null); +static ZEND_FUNCTION(zend_zval); +static ZEND_FUNCTION(zend_zval_or_null); +static ZEND_FUNCTION(zend_zval_separate); +static ZEND_FUNCTION(zend_zval_deref_separate); +static ZEND_FUNCTION(zend_zval_slow_zpp); +static ZEND_FUNCTION(zend_zval_or_null_slow_zpp); +static ZEND_FUNCTION(zend_variadic); +static ZEND_FUNCTION(zend_variadic_with_named); +static ZEND_FUNCTION(zend_variadic_slow_zpp); static ZEND_FUNCTION(zend_iterable); static ZEND_FUNCTION(zend_weakmap_attach); static ZEND_FUNCTION(zend_weakmap_remove); @@ -653,6 +865,64 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(zend_obj_stdclass_or_int_or_null, arginfo_zend_obj_stdclass_or_int_or_null) ZEND_FE(zend_number_or_string, arginfo_zend_number_or_string) ZEND_FE(zend_number_or_string_or_null, arginfo_zend_number_or_string_or_null) + ZEND_FE(zend_enum, arginfo_zend_enum) + ZEND_FE(zend_array, arginfo_zend_array) + ZEND_FE(zend_array_or_null, arginfo_zend_array_or_null) + ZEND_FE(zend_array_separate, arginfo_zend_array_separate) + ZEND_FE(zend_array_deref_separate, arginfo_zend_array_deref_separate) + ZEND_FE(zend_array_slow_zpp, arginfo_zend_array_slow_zpp) + ZEND_FE(zend_array_or_null_slow_zpp, arginfo_zend_array_or_null_slow_zpp) + ZEND_FE(zend_array_or_object, arginfo_zend_array_or_object) + ZEND_FE(zend_array_or_object_separate, arginfo_zend_array_or_object_separate) + ZEND_FE(zend_array_or_object_deref_separate, arginfo_zend_array_or_object_deref_separate) + ZEND_FE(zend_array_or_object_slow_zpp, arginfo_zend_array_or_object_slow_zpp) + ZEND_FE(zend_array_ht, arginfo_zend_array_ht) + ZEND_FE(zend_array_ht_or_null, arginfo_zend_array_ht_or_null) + ZEND_FE(zend_array_ht_separate, arginfo_zend_array_ht_separate) + ZEND_FE(zend_array_ht_deref_separate, arginfo_zend_array_ht_deref_separate) + ZEND_FE(zend_array_ht_slow_zpp, arginfo_zend_array_ht_slow_zpp) + ZEND_FE(zend_array_ht_or_null_slow_zpp, arginfo_zend_array_ht_or_null_slow_zpp) + ZEND_FE(zend_array_ht_or_long, arginfo_zend_array_ht_or_long) + ZEND_FE(zend_array_ht_or_long_or_null, arginfo_zend_array_ht_or_long_or_null) + ZEND_FE(zend_array_ht_or_str, arginfo_zend_array_ht_or_str) + ZEND_FE(zend_array_ht_or_str_or_null, arginfo_zend_array_ht_or_str_or_null) + ZEND_FE(zend_array_or_object_ht, arginfo_zend_array_or_object_ht) + ZEND_FE(zend_array_or_object_ht_separate, arginfo_zend_array_or_object_ht_separate) + ZEND_FE(zend_array_or_object_ht_deref_separate, arginfo_zend_array_or_object_ht_deref_separate) + ZEND_FE(zend_array_or_object_ht_slow_zpp, arginfo_zend_array_or_object_ht_slow_zpp) + ZEND_FE(zend_func, arginfo_zend_func) + ZEND_FE(zend_func_or_null, arginfo_zend_func_or_null) + ZEND_FE(zend_func_no_trampoline_free, arginfo_zend_func_no_trampoline_free) + ZEND_FE(zend_func_no_trampoline_free_or_null, arginfo_zend_func_no_trampoline_free_or_null) + ZEND_FE(zend_func_slow_zpp, arginfo_zend_func_slow_zpp) + ZEND_FE(zend_func_or_null_slow_zpp, arginfo_zend_func_or_null_slow_zpp) + ZEND_FE(zend_path, arginfo_zend_path) + ZEND_FE(zend_path_or_null, arginfo_zend_path_or_null) + ZEND_FE(zend_path_slow_zpp, arginfo_zend_path_slow_zpp) + ZEND_FE(zend_path_or_null_slow_zpp, arginfo_zend_path_or_null_slow_zpp) + ZEND_FE(zend_path_str, arginfo_zend_path_str) + ZEND_FE(zend_path_str_or_null, arginfo_zend_path_str_or_null) + ZEND_FE(zend_path_str_slow_zpp, arginfo_zend_path_str_slow_zpp) + ZEND_FE(zend_path_str_or_null_slow_zpp, arginfo_zend_path_str_or_null_slow_zpp) + ZEND_FE(zend_string_param, arginfo_zend_string_param) + ZEND_FE(zend_string_param_or_null, arginfo_zend_string_param_or_null) + ZEND_FE(zend_string_param_slow_zpp, arginfo_zend_string_param_slow_zpp) + ZEND_FE(zend_string_param_or_null_slow_zpp, arginfo_zend_string_param_or_null_slow_zpp) + ZEND_FE(zend_str, arginfo_zend_str) + ZEND_FE(zend_str_or_null, arginfo_zend_str_or_null) + ZEND_FE(zend_str_slow_zpp, arginfo_zend_str_slow_zpp) + ZEND_FE(zend_str_or_null_slow_zpp, arginfo_zend_str_or_null_slow_zpp) + ZEND_FE(zend_str_or_long, arginfo_zend_str_or_long) + ZEND_FE(zend_str_or_long_or_null, arginfo_zend_str_or_long_or_null) + ZEND_FE(zend_zval, arginfo_zend_zval) + ZEND_FE(zend_zval_or_null, arginfo_zend_zval_or_null) + ZEND_FE(zend_zval_separate, arginfo_zend_zval_separate) + ZEND_FE(zend_zval_deref_separate, arginfo_zend_zval_deref_separate) + ZEND_FE(zend_zval_slow_zpp, arginfo_zend_zval_slow_zpp) + ZEND_FE(zend_zval_or_null_slow_zpp, arginfo_zend_zval_or_null_slow_zpp) + ZEND_FE(zend_variadic, arginfo_zend_variadic) + ZEND_FE(zend_variadic_with_named, arginfo_zend_variadic_with_named) + ZEND_FE(zend_variadic_slow_zpp, arginfo_zend_variadic_slow_zpp) ZEND_FE(zend_iterable, arginfo_zend_iterable) ZEND_FE(zend_weakmap_attach, arginfo_zend_weakmap_attach) ZEND_FE(zend_weakmap_remove, arginfo_zend_weakmap_remove) diff --git a/ext/zend_test/test_decl.h b/ext/zend_test/test_decl.h index 7e41dc18eabb..26a527199a76 100644 --- a/ext/zend_test/test_decl.h +++ b/ext/zend_test/test_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 4d728e740122add9d4c91f5c1abb5f5017690636 */ + * Stub hash: 8e10a86b1ea68cbbce5dbe775078c766275a69a8 */ -#ifndef ZEND_TEST_DECL_4d728e740122add9d4c91f5c1abb5f5017690636_H -#define ZEND_TEST_DECL_4d728e740122add9d4c91f5c1abb5f5017690636_H +#ifndef ZEND_TEST_DECL_8e10a86b1ea68cbbce5dbe775078c766275a69a8_H +#define ZEND_TEST_DECL_8e10a86b1ea68cbbce5dbe775078c766275a69a8_H typedef enum zend_enum_ZendTestUnitEnum { ZEND_ENUM_ZendTestUnitEnum_Foo = 1, @@ -27,4 +27,4 @@ typedef enum zend_enum_ZendTestEnumWithInterface { ZEND_ENUM_ZendTestEnumWithInterface_Bar = 2, } zend_enum_ZendTestEnumWithInterface; -#endif /* ZEND_TEST_DECL_4d728e740122add9d4c91f5c1abb5f5017690636_H */ +#endif /* ZEND_TEST_DECL_8e10a86b1ea68cbbce5dbe775078c766275a69a8_H */ diff --git a/ext/zend_test/test_legacy_arginfo.h b/ext/zend_test/test_legacy_arginfo.h index 479a678df778..c2f2147a6662 100644 --- a/ext/zend_test/test_legacy_arginfo.h +++ b/ext/zend_test/test_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 4d728e740122add9d4c91f5c1abb5f5017690636 + * Stub hash: 8e10a86b1ea68cbbce5dbe775078c766275a69a8 * Has decl header: yes */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, 0) @@ -143,6 +143,126 @@ ZEND_END_ARG_INFO() #define arginfo_zend_number_or_string_or_null arginfo_zend_bool +#define arginfo_zend_enum arginfo_zend_bool + +#define arginfo_zend_array arginfo_zend_bool + +#define arginfo_zend_array_or_null arginfo_zend_bool + +#define arginfo_zend_array_separate arginfo_zend_bool + +ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_array_deref_separate, 0, 0, 1) + ZEND_ARG_INFO(1, param) +ZEND_END_ARG_INFO() + +#define arginfo_zend_array_slow_zpp arginfo_zend_bool + +#define arginfo_zend_array_or_null_slow_zpp arginfo_zend_bool + +#define arginfo_zend_array_or_object arginfo_zend_bool + +#define arginfo_zend_array_or_object_separate arginfo_zend_bool + +#define arginfo_zend_array_or_object_deref_separate arginfo_zend_array_deref_separate + +#define arginfo_zend_array_or_object_slow_zpp arginfo_zend_bool + +#define arginfo_zend_array_ht arginfo_zend_bool + +#define arginfo_zend_array_ht_or_null arginfo_zend_bool + +#define arginfo_zend_array_ht_separate arginfo_zend_bool + +#define arginfo_zend_array_ht_deref_separate arginfo_zend_array_deref_separate + +#define arginfo_zend_array_ht_slow_zpp arginfo_zend_bool + +#define arginfo_zend_array_ht_or_null_slow_zpp arginfo_zend_bool + +#define arginfo_zend_array_ht_or_long arginfo_zend_bool + +#define arginfo_zend_array_ht_or_long_or_null arginfo_zend_bool + +#define arginfo_zend_array_ht_or_str arginfo_zend_bool + +#define arginfo_zend_array_ht_or_str_or_null arginfo_zend_bool + +#define arginfo_zend_array_or_object_ht arginfo_zend_bool + +#define arginfo_zend_array_or_object_ht_separate arginfo_zend_bool + +#define arginfo_zend_array_or_object_ht_deref_separate arginfo_zend_array_deref_separate + +#define arginfo_zend_array_or_object_ht_slow_zpp arginfo_zend_bool + +#define arginfo_zend_func arginfo_zend_bool + +#define arginfo_zend_func_or_null arginfo_zend_bool + +#define arginfo_zend_func_no_trampoline_free arginfo_zend_bool + +#define arginfo_zend_func_no_trampoline_free_or_null arginfo_zend_bool + +#define arginfo_zend_func_slow_zpp arginfo_zend_bool + +#define arginfo_zend_func_or_null_slow_zpp arginfo_zend_bool + +#define arginfo_zend_path arginfo_zend_bool + +#define arginfo_zend_path_or_null arginfo_zend_bool + +#define arginfo_zend_path_slow_zpp arginfo_zend_bool + +#define arginfo_zend_path_or_null_slow_zpp arginfo_zend_bool + +#define arginfo_zend_path_str arginfo_zend_bool + +#define arginfo_zend_path_str_or_null arginfo_zend_bool + +#define arginfo_zend_path_str_slow_zpp arginfo_zend_bool + +#define arginfo_zend_path_str_or_null_slow_zpp arginfo_zend_bool + +#define arginfo_zend_string_param arginfo_zend_bool + +#define arginfo_zend_string_param_or_null arginfo_zend_bool + +#define arginfo_zend_string_param_slow_zpp arginfo_zend_bool + +#define arginfo_zend_string_param_or_null_slow_zpp arginfo_zend_bool + +#define arginfo_zend_str arginfo_zend_bool + +#define arginfo_zend_str_or_null arginfo_zend_bool + +#define arginfo_zend_str_slow_zpp arginfo_zend_bool + +#define arginfo_zend_str_or_null_slow_zpp arginfo_zend_bool + +#define arginfo_zend_str_or_long arginfo_zend_bool + +#define arginfo_zend_str_or_long_or_null arginfo_zend_bool + +#define arginfo_zend_zval arginfo_zend_bool + +#define arginfo_zend_zval_or_null arginfo_zend_bool + +#define arginfo_zend_zval_separate arginfo_zend_bool + +#define arginfo_zend_zval_deref_separate arginfo_zend_array_deref_separate + +#define arginfo_zend_zval_slow_zpp arginfo_zend_bool + +#define arginfo_zend_zval_or_null_slow_zpp arginfo_zend_bool + +ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_variadic, 0, 0, 0) + ZEND_ARG_VARIADIC_INFO(0, args) +ZEND_END_ARG_INFO() + +#define arginfo_zend_variadic_with_named arginfo_zend_variadic + +#define arginfo_zend_variadic_slow_zpp arginfo_zend_variadic + ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_iterable, 0, 0, 1) ZEND_ARG_INFO(0, arg1) ZEND_ARG_INFO(0, arg2) @@ -402,6 +522,64 @@ static ZEND_FUNCTION(zend_obj_stdclass_or_int); static ZEND_FUNCTION(zend_obj_stdclass_or_int_or_null); static ZEND_FUNCTION(zend_number_or_string); static ZEND_FUNCTION(zend_number_or_string_or_null); +static ZEND_FUNCTION(zend_enum); +static ZEND_FUNCTION(zend_array); +static ZEND_FUNCTION(zend_array_or_null); +static ZEND_FUNCTION(zend_array_separate); +static ZEND_FUNCTION(zend_array_deref_separate); +static ZEND_FUNCTION(zend_array_slow_zpp); +static ZEND_FUNCTION(zend_array_or_null_slow_zpp); +static ZEND_FUNCTION(zend_array_or_object); +static ZEND_FUNCTION(zend_array_or_object_separate); +static ZEND_FUNCTION(zend_array_or_object_deref_separate); +static ZEND_FUNCTION(zend_array_or_object_slow_zpp); +static ZEND_FUNCTION(zend_array_ht); +static ZEND_FUNCTION(zend_array_ht_or_null); +static ZEND_FUNCTION(zend_array_ht_separate); +static ZEND_FUNCTION(zend_array_ht_deref_separate); +static ZEND_FUNCTION(zend_array_ht_slow_zpp); +static ZEND_FUNCTION(zend_array_ht_or_null_slow_zpp); +static ZEND_FUNCTION(zend_array_ht_or_long); +static ZEND_FUNCTION(zend_array_ht_or_long_or_null); +static ZEND_FUNCTION(zend_array_ht_or_str); +static ZEND_FUNCTION(zend_array_ht_or_str_or_null); +static ZEND_FUNCTION(zend_array_or_object_ht); +static ZEND_FUNCTION(zend_array_or_object_ht_separate); +static ZEND_FUNCTION(zend_array_or_object_ht_deref_separate); +static ZEND_FUNCTION(zend_array_or_object_ht_slow_zpp); +static ZEND_FUNCTION(zend_func); +static ZEND_FUNCTION(zend_func_or_null); +static ZEND_FUNCTION(zend_func_no_trampoline_free); +static ZEND_FUNCTION(zend_func_no_trampoline_free_or_null); +static ZEND_FUNCTION(zend_func_slow_zpp); +static ZEND_FUNCTION(zend_func_or_null_slow_zpp); +static ZEND_FUNCTION(zend_path); +static ZEND_FUNCTION(zend_path_or_null); +static ZEND_FUNCTION(zend_path_slow_zpp); +static ZEND_FUNCTION(zend_path_or_null_slow_zpp); +static ZEND_FUNCTION(zend_path_str); +static ZEND_FUNCTION(zend_path_str_or_null); +static ZEND_FUNCTION(zend_path_str_slow_zpp); +static ZEND_FUNCTION(zend_path_str_or_null_slow_zpp); +static ZEND_FUNCTION(zend_string_param); +static ZEND_FUNCTION(zend_string_param_or_null); +static ZEND_FUNCTION(zend_string_param_slow_zpp); +static ZEND_FUNCTION(zend_string_param_or_null_slow_zpp); +static ZEND_FUNCTION(zend_str); +static ZEND_FUNCTION(zend_str_or_null); +static ZEND_FUNCTION(zend_str_slow_zpp); +static ZEND_FUNCTION(zend_str_or_null_slow_zpp); +static ZEND_FUNCTION(zend_str_or_long); +static ZEND_FUNCTION(zend_str_or_long_or_null); +static ZEND_FUNCTION(zend_zval); +static ZEND_FUNCTION(zend_zval_or_null); +static ZEND_FUNCTION(zend_zval_separate); +static ZEND_FUNCTION(zend_zval_deref_separate); +static ZEND_FUNCTION(zend_zval_slow_zpp); +static ZEND_FUNCTION(zend_zval_or_null_slow_zpp); +static ZEND_FUNCTION(zend_variadic); +static ZEND_FUNCTION(zend_variadic_with_named); +static ZEND_FUNCTION(zend_variadic_slow_zpp); static ZEND_FUNCTION(zend_iterable); static ZEND_FUNCTION(zend_weakmap_attach); static ZEND_FUNCTION(zend_weakmap_remove); @@ -550,6 +728,64 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(zend_obj_stdclass_or_int_or_null, arginfo_zend_obj_stdclass_or_int_or_null) ZEND_FE(zend_number_or_string, arginfo_zend_number_or_string) ZEND_FE(zend_number_or_string_or_null, arginfo_zend_number_or_string_or_null) + ZEND_FE(zend_enum, arginfo_zend_enum) + ZEND_FE(zend_array, arginfo_zend_array) + ZEND_FE(zend_array_or_null, arginfo_zend_array_or_null) + ZEND_FE(zend_array_separate, arginfo_zend_array_separate) + ZEND_FE(zend_array_deref_separate, arginfo_zend_array_deref_separate) + ZEND_FE(zend_array_slow_zpp, arginfo_zend_array_slow_zpp) + ZEND_FE(zend_array_or_null_slow_zpp, arginfo_zend_array_or_null_slow_zpp) + ZEND_FE(zend_array_or_object, arginfo_zend_array_or_object) + ZEND_FE(zend_array_or_object_separate, arginfo_zend_array_or_object_separate) + ZEND_FE(zend_array_or_object_deref_separate, arginfo_zend_array_or_object_deref_separate) + ZEND_FE(zend_array_or_object_slow_zpp, arginfo_zend_array_or_object_slow_zpp) + ZEND_FE(zend_array_ht, arginfo_zend_array_ht) + ZEND_FE(zend_array_ht_or_null, arginfo_zend_array_ht_or_null) + ZEND_FE(zend_array_ht_separate, arginfo_zend_array_ht_separate) + ZEND_FE(zend_array_ht_deref_separate, arginfo_zend_array_ht_deref_separate) + ZEND_FE(zend_array_ht_slow_zpp, arginfo_zend_array_ht_slow_zpp) + ZEND_FE(zend_array_ht_or_null_slow_zpp, arginfo_zend_array_ht_or_null_slow_zpp) + ZEND_FE(zend_array_ht_or_long, arginfo_zend_array_ht_or_long) + ZEND_FE(zend_array_ht_or_long_or_null, arginfo_zend_array_ht_or_long_or_null) + ZEND_FE(zend_array_ht_or_str, arginfo_zend_array_ht_or_str) + ZEND_FE(zend_array_ht_or_str_or_null, arginfo_zend_array_ht_or_str_or_null) + ZEND_FE(zend_array_or_object_ht, arginfo_zend_array_or_object_ht) + ZEND_FE(zend_array_or_object_ht_separate, arginfo_zend_array_or_object_ht_separate) + ZEND_FE(zend_array_or_object_ht_deref_separate, arginfo_zend_array_or_object_ht_deref_separate) + ZEND_FE(zend_array_or_object_ht_slow_zpp, arginfo_zend_array_or_object_ht_slow_zpp) + ZEND_FE(zend_func, arginfo_zend_func) + ZEND_FE(zend_func_or_null, arginfo_zend_func_or_null) + ZEND_FE(zend_func_no_trampoline_free, arginfo_zend_func_no_trampoline_free) + ZEND_FE(zend_func_no_trampoline_free_or_null, arginfo_zend_func_no_trampoline_free_or_null) + ZEND_FE(zend_func_slow_zpp, arginfo_zend_func_slow_zpp) + ZEND_FE(zend_func_or_null_slow_zpp, arginfo_zend_func_or_null_slow_zpp) + ZEND_FE(zend_path, arginfo_zend_path) + ZEND_FE(zend_path_or_null, arginfo_zend_path_or_null) + ZEND_FE(zend_path_slow_zpp, arginfo_zend_path_slow_zpp) + ZEND_FE(zend_path_or_null_slow_zpp, arginfo_zend_path_or_null_slow_zpp) + ZEND_FE(zend_path_str, arginfo_zend_path_str) + ZEND_FE(zend_path_str_or_null, arginfo_zend_path_str_or_null) + ZEND_FE(zend_path_str_slow_zpp, arginfo_zend_path_str_slow_zpp) + ZEND_FE(zend_path_str_or_null_slow_zpp, arginfo_zend_path_str_or_null_slow_zpp) + ZEND_FE(zend_string_param, arginfo_zend_string_param) + ZEND_FE(zend_string_param_or_null, arginfo_zend_string_param_or_null) + ZEND_FE(zend_string_param_slow_zpp, arginfo_zend_string_param_slow_zpp) + ZEND_FE(zend_string_param_or_null_slow_zpp, arginfo_zend_string_param_or_null_slow_zpp) + ZEND_FE(zend_str, arginfo_zend_str) + ZEND_FE(zend_str_or_null, arginfo_zend_str_or_null) + ZEND_FE(zend_str_slow_zpp, arginfo_zend_str_slow_zpp) + ZEND_FE(zend_str_or_null_slow_zpp, arginfo_zend_str_or_null_slow_zpp) + ZEND_FE(zend_str_or_long, arginfo_zend_str_or_long) + ZEND_FE(zend_str_or_long_or_null, arginfo_zend_str_or_long_or_null) + ZEND_FE(zend_zval, arginfo_zend_zval) + ZEND_FE(zend_zval_or_null, arginfo_zend_zval_or_null) + ZEND_FE(zend_zval_separate, arginfo_zend_zval_separate) + ZEND_FE(zend_zval_deref_separate, arginfo_zend_zval_deref_separate) + ZEND_FE(zend_zval_slow_zpp, arginfo_zend_zval_slow_zpp) + ZEND_FE(zend_zval_or_null_slow_zpp, arginfo_zend_zval_or_null_slow_zpp) + ZEND_FE(zend_variadic, arginfo_zend_variadic) + ZEND_FE(zend_variadic_with_named, arginfo_zend_variadic_with_named) + ZEND_FE(zend_variadic_slow_zpp, arginfo_zend_variadic_slow_zpp) ZEND_FE(zend_iterable, arginfo_zend_iterable) ZEND_FE(zend_weakmap_attach, arginfo_zend_weakmap_attach) ZEND_FE(zend_weakmap_remove, arginfo_zend_weakmap_remove)