xref: /PHP-7.2/ext/opcache/tests/bug75357.phpt (revision abbdbc21)
1--TEST--
2Bug #75357 (segfault loading WordPress wp-admin)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7--SKIPIF--
8<?php require_once('skipif.inc'); ?>
9--FILE--
10<?php
11
12function wp_slash( $value ) {
13	if ( is_array( $value ) ) {
14		foreach ( $value as $k => $v ) {
15			if ( is_array( $v ) ) {
16				$value[$k] = wp_slash( $v );
17			} else {
18				$value[$k] = addslashes( $v );
19			}
20		}
21	} else {
22		$value = addslashes( $value );
23	}
24
25	return $value;
26}
27
28function addslashes_gpc($gpc) {
29	if ( get_magic_quotes_gpc() )
30		$gpc = stripslashes($gpc);
31
32	return wp_slash($gpc);
33}
34
35var_dump(addslashes_gpc(array(array("test"))));
36?>
37--EXPECT--
38array(1) {
39  [0]=>
40  array(1) {
41    [0]=>
42    string(4) "test"
43  }
44}
45