--TEST--
Return type and Reflection::export()
-
--SKIPIF--
<?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70000) {
- print 'skip';
-}
-
+if (!extension_loaded('reflection')) print 'skip';
+?>
--FILE--
<?php
+++ /dev/null
---TEST--
-unset() CV 7 (indirect unset() of global variable in import_request_variables())
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-x=2
---FILE--
-<?php
-$_x = "1\n";
-echo $_x;
-import_request_variables("g","_");
-echo $_x;
-echo "\nok\n";
-?>
---EXPECTF--
-1
-2
-ok
+++ /dev/null
---TEST--
-Test posix_access() function test
---DESCRIPTION--
-checks for existence, read-access, write-access, execute-access
---CREDITS--
-Moritz Neuhaeuser, info@xcompile.net
-PHP Testfest Berlin 2009-05-10
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
- die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
- die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
- die('SKIP Safe mode is no longer available.');
-}
-?>
---FILE--
-<?php
-$filename = dirname(__FILE__) . '/foo.test';
-$fp = fopen($filename,"w");
-fwrite($fp,"foo");
-fclose($fp);
-
-chmod ($filename, 0000);
-var_dump(posix_access($filename, POSIX_F_OK));
-
-chmod ($filename, 0400);
-var_dump(posix_access($filename, POSIX_R_OK));
-
-chmod ($filename, 0600);
-var_dump(posix_access($filename, POSIX_W_OK));
-
-chmod ($filename, 0700);
-var_dump(posix_access($filename, POSIX_X_OK));
-?>
-===DONE===
---CLEAN--
-<?php
-$filename = dirname(__FILE__) . '/foo.test';
-chmod ($filename, 0700);
-unlink($filename);
-?>
---EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in %s on line %d
-bool(true)
-bool(true)
-bool(true)
-bool(true)
-===DONE===
+++ /dev/null
---TEST--
-Test posix_access() function test error conditions
---DESCRIPTION--
-checks if posix_access() failes for wrong permissions
---CREDITS--
-Moritz Neuhaeuser, info@xcompile.net
-PHP Testfest Berlin 2009-05-10
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
- die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
- die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
- die('SKIP Safe mode is no longer available.');
-}
-?>
---FILE--
-<?php
-$filename = dirname(__FILE__) . '/foo.test';
-var_dump(posix_access($filename, POSIX_F_OK));
-$fp = fopen($filename,"w");
-fwrite($fp,"foo");
-fclose($fp);
-
-chmod ($filename, 0000);
-var_dump(posix_access($filename, POSIX_R_OK));
-var_dump(posix_access($filename, POSIX_W_OK));
-var_dump(posix_access($filename, POSIX_X_OK));
-?>
-===DONE===
---CLEAN--
-<?php
-$filename = dirname(__FILE__) . '/foo.test';
-chmod ($filename, 0700);
-unlink($filename);
-?>
---EXPECTF--
-WDeprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line %d
-bool(false)
-bool(false)
-bool(false)
-bool(false)
-===DONE===
+++ /dev/null
---TEST--
-Test posix_access() function : parameter validation
---DESCRIPTION--
-cases: no params, wrong param1, wrong param2, null directory, wrong directory,
---CREDITS--
-Moritz Neuhaeuser, info@xcompile.net
-PHP Testfest Berlin 2009-05-10
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
- die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
- die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
- die('SKIP Safe mode is no longer available.');
-}
-?>
---FILE--
-<?php
-
-var_dump( posix_access() );
-var_dump( posix_access(array()) );
-var_dump( posix_access('foo',array()) );
-var_dump( posix_access(null) );
-
-var_dump(posix_access('./foobar'));
-?>
-===DONE===
---EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
-
-Warning: posix_access() expects at least 1 parameter, 0 given in %s on line %d
-bool(false)
-
-Warning: posix_access() expects parameter 1 to be string, array given in %s on line %d
-bool(false)
-
-Warning: posix_access() expects parameter 2 to be integer, array given in %s on line %d
-bool(false)
-bool(false)
-bool(false)
-===DONE===
+++ /dev/null
---TEST--
-Test posix_access() with safe_mode enabled.
---CREDITS--
-Till Klampaeckel, till@php.net
-TestFest Berlin 2009
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
- die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
- die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
- die('SKIP Safe mode is no longer available.');
-}
---FILE--
-<?php
-var_dump(posix_access('/tmp', POSIX_W_OK));
-?>
-===DONE===
---EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in %s on line %d
-bool(false)
-===DONE===
+++ /dev/null
---TEST--
-Test posix_mkfifo() with safe_mode.
---DESCRIPTION--
-The test attempts to enable safe_mode, catches all the relevant E_WARNING's and tries to create a fifo in /tmp.
-
-The first attempt (writing to /tmp) should effectively fail because /tmp is owned by root.
-
-The second attempt (writing to a local created file) works.
---CREDITS--
-Till Klampaeckel, till@php.net
-TestFest Berlin 2009
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
- die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
- die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
- die('SKIP Safe mode is no longer available.');
-}
-?>
---FILE--
-<?php
-var_dump(posix_mkfifo('/tmp/foobar', 0644));
-
-$dir = dirname(__FILE__) . '/foo';
-mkdir ($dir);
-var_dump(posix_mkfifo($dir . '/bar', 0644));
-?>
-===DONE===
---CLEAN--
-<?php
-$dir = dirname(__FILE__) . '/foo';
-unlink($dir . '/bar');
-rmdir($dir);
-?>
---EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in %s on line %d
-
-Warning: posix_mkfifo(): SAFE MODE Restriction in effect. The script whose uid is %d is not allowed to access /tmp owned by uid %d in %s on line %d
-bool(false)
-bool(true)
-===DONE===
Reflection::getClosureScopeClass()
--SKIPIF--
<?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50399) {
- print 'skip';
-}
+if (!extension_loaded('reflection')) print 'skip';
?>
--FILE--
<?php
Reflection::getClosureThis()
--SKIPIF--
<?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
- print 'skip';
-}
+if (!extension_loaded('reflection')) print 'skip';
?>
--FILE--
<?php
TestFest PHP|Tek
--SKIPIF--
<?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
- print 'skip';
-}
+if (!extension_loaded('reflection')) print 'skip';
?>
--FILE--
<?php
Reflection::getClosureThis()
--SKIPIF--
<?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
- print 'skip';
-}
+if (!extension_loaded('reflection')) print 'skip';
?>
--FILE--
<?php
+++ /dev/null
---TEST--
-import_request_variables() tests
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-a=1&b=heh&c=3&d[]=5&GLOBALS=test&1=hm
---POST--
-ap=25&bp=test&cp=blah3&dp[]=ar
---FILE--
-<?php
-
-var_dump(import_request_variables());
-var_dump(import_request_variables(""));
-var_dump(import_request_variables("", ""));
-
-var_dump(import_request_variables("g", ""));
-var_dump($a, $b, $c, $ap);
-
-var_dump(import_request_variables("g", "g_"));
-var_dump($g_a, $g_b, $g_c, $g_ap, $g_1);
-
-var_dump(import_request_variables("GP", "i_"));
-var_dump($i_a, $i_b, $i_c, $i_ap, $i_bp, $i_cp, $i_dp);
-
-var_dump(import_request_variables("gGg", "r_"));
-var_dump($r_a, $r_b, $r_c, $r_ap);
-
-echo "Done\n";
-?>
---EXPECTF--
-Warning: import_request_variables() expects at least 1 parameter, 0 given in %s on line %d
-NULL
-bool(false)
-
-Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d
-bool(false)
-
-Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d
-
-Warning: import_request_variables(): Attempted GLOBALS variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Numeric key detected - possible security hazard in %s on line %d
-bool(true)
-
-Notice: Undefined variable: ap in %s on line %d
-string(1) "1"
-string(3) "heh"
-string(1) "3"
-NULL
-bool(true)
-
-Notice: Undefined variable: g_ap in %s on line %d
-string(1) "1"
-string(3) "heh"
-string(1) "3"
-NULL
-string(2) "hm"
-bool(true)
-string(1) "1"
-string(3) "heh"
-string(1) "3"
-string(2) "25"
-string(4) "test"
-string(5) "blah3"
-array(1) {
- [0]=>
- string(2) "ar"
-}
-bool(true)
-
-Notice: Undefined variable: r_ap in %s on line %d
-string(1) "1"
-string(3) "heh"
-string(1) "3"
-NULL
-Done
+++ /dev/null
---TEST--
-import_request_variables() test (overwrite super-globals)
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-GET=0&POST=1&COOKIE=2&FILES=3&REQUEST=4
---POST--
-GET=5&POST=6&COOKIE=7&FILES=8&REQUEST=9
---COOKIE--
-GET=10;POST=11;COOKIE=12;FILES=13;REQUEST=14
---INI--
-variables_order=CGP
---FILE--
-<?php
-
-import_request_variables("gpc", "_");
-var_dump($_GET, $_POST, $_COOKIE, $_FILES, $_REQUEST);
-
-echo "Done\n";
-?>
---EXPECTF--
-Warning: import_request_variables(): Attempted super-global (_GET) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_POST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_COOKIE) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_FILES) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_REQUEST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_GET) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_POST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_COOKIE) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_FILES) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_REQUEST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_GET) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_POST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_COOKIE) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_FILES) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_REQUEST) variable overwrite in %s on line %d
-array(5) {
- ["GET"]=>
- string(1) "0"
- ["POST"]=>
- string(1) "1"
- ["COOKIE"]=>
- string(1) "2"
- ["FILES"]=>
- string(1) "3"
- ["REQUEST"]=>
- string(1) "4"
-}
-array(5) {
- ["GET"]=>
- string(1) "5"
- ["POST"]=>
- string(1) "6"
- ["COOKIE"]=>
- string(1) "7"
- ["FILES"]=>
- string(1) "8"
- ["REQUEST"]=>
- string(1) "9"
-}
-array(5) {
- ["GET"]=>
- string(2) "10"
- ["POST"]=>
- string(2) "11"
- ["COOKIE"]=>
- string(2) "12"
- ["FILES"]=>
- string(2) "13"
- ["REQUEST"]=>
- string(2) "14"
-}
-array(0) {
-}
-array(5) {
- ["GET"]=>
- string(1) "5"
- ["POST"]=>
- string(1) "6"
- ["COOKIE"]=>
- string(1) "7"
- ["FILES"]=>
- string(1) "8"
- ["REQUEST"]=>
- string(1) "9"
-}
-Done
+++ /dev/null
---TEST--
-import_request_variables() test (numeric keys)
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-1=0&2=1&3=2&4=3&5=4
---POST--
-1=5&2=6&3=7&4=8&5=9
---COOKIE--
-1=10;2=11;3=12;4=13;5=14
---INI--
-variables_order=CGP
---FILE--
-<?php
-
-import_request_variables("gpc", "_");
-var_dump($_1, $_2, $_3, $_4, $_5);
-
-echo "Done\n";
-?>
---EXPECTF--
-string(2) "10"
-string(2) "11"
-string(2) "12"
-string(2) "13"
-string(2) "14"
-Done
+++ /dev/null
---TEST--
-import_request_variables() test (numeric keys, different order)
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-1=0&2=1&3=2&4=3&5=4
---POST--
-1=5&2=6&3=7&4=8&5=9
---COOKIE--
-1=10;2=11;3=12;4=13;5=14
---INI--
-variables_order=CGP
---FILE--
-<?php
-
-import_request_variables("gcp", "_");
-var_dump($_1, $_2, $_3, $_4, $_5);
-
-echo "Done\n";
-?>
---EXPECTF--
-string(1) "5"
-string(1) "6"
-string(1) "7"
-string(1) "8"
-string(1) "9"
-Done