@@ -1730,7 +1730,6 @@ PHPAPI int php_prefix_varname(zval *result, const zval *prefix, const char *var_
1730
1730
1731
1731
static zend_long php_extract_ref_if_exists (zend_array * arr , zend_array * symbol_table ) /* {{{ */
1732
1732
{
1733
- int exception_thrown = 0 ;
1734
1733
zend_long count = 0 ;
1735
1734
zend_string * var_name ;
1736
1735
zval * entry , * orig_var ;
@@ -1754,11 +1753,8 @@ static zend_long php_extract_ref_if_exists(zend_array *arr, zend_array *symbol_t
1754
1753
continue ;
1755
1754
}
1756
1755
if (zend_string_equals_literal (var_name , "this" )) {
1757
- if (!exception_thrown ) {
1758
- exception_thrown = 1 ;
1759
- zend_throw_error (NULL , "Cannot re-assign $this" );
1760
- }
1761
- continue ;
1756
+ zend_throw_error (NULL , "Cannot re-assign $this" );
1757
+ return -1 ;
1762
1758
}
1763
1759
if (Z_ISREF_P (entry )) {
1764
1760
Z_ADDREF_P (entry );
@@ -1777,7 +1773,6 @@ static zend_long php_extract_ref_if_exists(zend_array *arr, zend_array *symbol_t
1777
1773
1778
1774
static zend_long php_extract_if_exists (zend_array * arr , zend_array * symbol_table ) /* {{{ */
1779
1775
{
1780
- int exception_thrown = 0 ;
1781
1776
zend_long count = 0 ;
1782
1777
zend_string * var_name ;
1783
1778
zval * entry , * orig_var ;
@@ -1801,11 +1796,8 @@ static zend_long php_extract_if_exists(zend_array *arr, zend_array *symbol_table
1801
1796
continue ;
1802
1797
}
1803
1798
if (zend_string_equals_literal (var_name , "this" )) {
1804
- if (!exception_thrown ) {
1805
- exception_thrown = 1 ;
1806
- zend_throw_error (NULL , "Cannot re-assign $this" );
1807
- }
1808
- continue ;
1799
+ zend_throw_error (NULL , "Cannot re-assign $this" );
1800
+ return -1 ;
1809
1801
}
1810
1802
ZVAL_DEREF (entry );
1811
1803
ZVAL_DEREF (orig_var );
@@ -1821,7 +1813,6 @@ static zend_long php_extract_if_exists(zend_array *arr, zend_array *symbol_table
1821
1813
1822
1814
static zend_long php_extract_ref_overwrite (zend_array * arr , zend_array * symbol_table ) /* {{{ */
1823
1815
{
1824
- int exception_thrown = 0 ;
1825
1816
zend_long count = 0 ;
1826
1817
zend_string * var_name ;
1827
1818
zval * entry , * orig_var ;
@@ -1834,11 +1825,8 @@ static zend_long php_extract_ref_overwrite(zend_array *arr, zend_array *symbol_t
1834
1825
continue ;
1835
1826
}
1836
1827
if (zend_string_equals_literal (var_name , "this" )) {
1837
- if (!exception_thrown ) {
1838
- exception_thrown = 1 ;
1839
- zend_throw_error (NULL , "Cannot re-assign $this" );
1840
- }
1841
- continue ;
1828
+ zend_throw_error (NULL , "Cannot re-assign $this" );
1829
+ return -1 ;
1842
1830
}
1843
1831
orig_var = zend_hash_find_ex (symbol_table , var_name , 1 );
1844
1832
if (orig_var ) {
@@ -1872,7 +1860,6 @@ static zend_long php_extract_ref_overwrite(zend_array *arr, zend_array *symbol_t
1872
1860
1873
1861
static zend_long php_extract_overwrite (zend_array * arr , zend_array * symbol_table ) /* {{{ */
1874
1862
{
1875
- int exception_thrown = 0 ;
1876
1863
zend_long count = 0 ;
1877
1864
zend_string * var_name ;
1878
1865
zval * entry , * orig_var ;
@@ -1885,11 +1872,8 @@ static zend_long php_extract_overwrite(zend_array *arr, zend_array *symbol_table
1885
1872
continue ;
1886
1873
}
1887
1874
if (zend_string_equals_literal (var_name , "this" )) {
1888
- if (!exception_thrown ) {
1889
- exception_thrown = 1 ;
1890
- zend_throw_error (NULL , "Cannot re-assign $this" );
1891
- }
1892
- continue ;
1875
+ zend_throw_error (NULL , "Cannot re-assign $this" );
1876
+ return -1 ;
1893
1877
}
1894
1878
orig_var = zend_hash_find_ex (symbol_table , var_name , 1 );
1895
1879
if (orig_var ) {
@@ -1917,7 +1901,6 @@ static zend_long php_extract_overwrite(zend_array *arr, zend_array *symbol_table
1917
1901
1918
1902
static zend_long php_extract_ref_prefix_if_exists (zend_array * arr , zend_array * symbol_table , zval * prefix ) /* {{{ */
1919
1903
{
1920
- int exception_thrown = 0 ;
1921
1904
zend_long count = 0 ;
1922
1905
zend_string * var_name ;
1923
1906
zval * entry , * orig_var , final_name ;
@@ -1944,10 +1927,8 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s
1944
1927
php_prefix_varname (& final_name , prefix , ZSTR_VAL (var_name ), ZSTR_LEN (var_name ), 1 );
1945
1928
if (php_valid_var_name (Z_STRVAL (final_name ), Z_STRLEN (final_name ))) {
1946
1929
if (zend_string_equals_literal (Z_STR (final_name ), "this" )) {
1947
- if (!exception_thrown ) {
1948
- exception_thrown = 1 ;
1949
- zend_throw_error (NULL , "Cannot re-assign $this" );
1950
- }
1930
+ zend_throw_error (NULL , "Cannot re-assign $this" );
1931
+ return -1 ;
1951
1932
} else {
1952
1933
if (Z_ISREF_P (entry )) {
1953
1934
Z_ADDREF_P (entry );
@@ -1976,7 +1957,6 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s
1976
1957
1977
1958
static zend_long php_extract_prefix_if_exists (zend_array * arr , zend_array * symbol_table , zval * prefix ) /* {{{ */
1978
1959
{
1979
- int exception_thrown = 0 ;
1980
1960
zend_long count = 0 ;
1981
1961
zend_string * var_name ;
1982
1962
zval * entry , * orig_var , final_name ;
@@ -1999,10 +1979,8 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo
1999
1979
php_prefix_varname (& final_name , prefix , ZSTR_VAL (var_name ), ZSTR_LEN (var_name ), 1 );
2000
1980
if (php_valid_var_name (Z_STRVAL (final_name ), Z_STRLEN (final_name ))) {
2001
1981
if (zend_string_equals_literal (Z_STR (final_name ), "this" )) {
2002
- if (!exception_thrown ) {
2003
- exception_thrown = 1 ;
2004
- zend_throw_error (NULL , "Cannot re-assign $this" );
2005
- }
1982
+ zend_throw_error (NULL , "Cannot re-assign $this" );
1983
+ return -1 ;
2006
1984
} else {
2007
1985
ZVAL_DEREF (entry );
2008
1986
if ((orig_var = zend_hash_find (symbol_table , Z_STR (final_name ))) != NULL ) {
@@ -2029,7 +2007,6 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo
2029
2007
2030
2008
static zend_long php_extract_ref_prefix_same (zend_array * arr , zend_array * symbol_table , zval * prefix ) /* {{{ */
2031
2009
{
2032
- int exception_thrown = 0 ;
2033
2010
zend_long count = 0 ;
2034
2011
zend_string * var_name ;
2035
2012
zval * entry , * orig_var , final_name ;
@@ -2059,10 +2036,8 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol
2059
2036
php_prefix_varname (& final_name , prefix , ZSTR_VAL (var_name ), ZSTR_LEN (var_name ), 1 );
2060
2037
if (php_valid_var_name (Z_STRVAL (final_name ), Z_STRLEN (final_name ))) {
2061
2038
if (zend_string_equals_literal (Z_STR (final_name ), "this" )) {
2062
- if (!exception_thrown ) {
2063
- exception_thrown = 1 ;
2064
- zend_throw_error (NULL , "Cannot re-assign $this" );
2065
- }
2039
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2040
+ return -1 ;
2066
2041
} else {
2067
2042
if (Z_ISREF_P (entry )) {
2068
2043
Z_ADDREF_P (entry );
@@ -2087,11 +2062,8 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol
2087
2062
continue ;
2088
2063
}
2089
2064
if (zend_string_equals_literal (var_name , "this" )) {
2090
- if (!exception_thrown ) {
2091
- exception_thrown = 1 ;
2092
- zend_throw_error (NULL , "Cannot re-assign $this" );
2093
- }
2094
- continue ;
2065
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2066
+ return -1 ;
2095
2067
}
2096
2068
if (Z_ISREF_P (entry )) {
2097
2069
Z_ADDREF_P (entry );
@@ -2109,7 +2081,6 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol
2109
2081
2110
2082
static zend_long php_extract_prefix_same (zend_array * arr , zend_array * symbol_table , zval * prefix ) /* {{{ */
2111
2083
{
2112
- int exception_thrown = 0 ;
2113
2084
zend_long count = 0 ;
2114
2085
zend_string * var_name ;
2115
2086
zval * entry , * orig_var , final_name ;
@@ -2135,10 +2106,8 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab
2135
2106
php_prefix_varname (& final_name , prefix , ZSTR_VAL (var_name ), ZSTR_LEN (var_name ), 1 );
2136
2107
if (php_valid_var_name (Z_STRVAL (final_name ), Z_STRLEN (final_name ))) {
2137
2108
if (zend_string_equals_literal (Z_STR (final_name ), "this" )) {
2138
- if (!exception_thrown ) {
2139
- exception_thrown = 1 ;
2140
- zend_throw_error (NULL , "Cannot re-assign $this" );
2141
- }
2109
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2110
+ return -1 ;
2142
2111
} else {
2143
2112
ZVAL_DEREF (entry );
2144
2113
if ((orig_var = zend_hash_find (symbol_table , Z_STR (final_name ))) != NULL ) {
@@ -2161,11 +2130,8 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab
2161
2130
continue ;
2162
2131
}
2163
2132
if (zend_string_equals_literal (var_name , "this" )) {
2164
- if (!exception_thrown ) {
2165
- exception_thrown = 1 ;
2166
- zend_throw_error (NULL , "Cannot re-assign $this" );
2167
- }
2168
- continue ;
2133
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2134
+ return -1 ;
2169
2135
}
2170
2136
ZVAL_DEREF (entry );
2171
2137
Z_TRY_ADDREF_P (entry );
@@ -2180,7 +2146,6 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab
2180
2146
2181
2147
static zend_long php_extract_ref_prefix_all (zend_array * arr , zend_array * symbol_table , zval * prefix ) /* {{{ */
2182
2148
{
2183
- int exception_thrown = 0 ;
2184
2149
zend_long count = 0 ;
2185
2150
zend_string * var_name ;
2186
2151
zend_ulong num_key ;
@@ -2199,10 +2164,8 @@ static zend_long php_extract_ref_prefix_all(zend_array *arr, zend_array *symbol_
2199
2164
}
2200
2165
if (php_valid_var_name (Z_STRVAL (final_name ), Z_STRLEN (final_name ))) {
2201
2166
if (zend_string_equals_literal (Z_STR (final_name ), "this" )) {
2202
- if (!exception_thrown ) {
2203
- exception_thrown = 1 ;
2204
- zend_throw_error (NULL , "Cannot re-assign $this" );
2205
- }
2167
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2168
+ return -1 ;
2206
2169
} else {
2207
2170
if (Z_ISREF_P (entry )) {
2208
2171
Z_ADDREF_P (entry );
@@ -2230,7 +2193,6 @@ static zend_long php_extract_ref_prefix_all(zend_array *arr, zend_array *symbol_
2230
2193
2231
2194
static zend_long php_extract_prefix_all (zend_array * arr , zend_array * symbol_table , zval * prefix ) /* {{{ */
2232
2195
{
2233
- int exception_thrown = 0 ;
2234
2196
zend_long count = 0 ;
2235
2197
zend_string * var_name ;
2236
2198
zend_ulong num_key ;
@@ -2249,10 +2211,8 @@ static zend_long php_extract_prefix_all(zend_array *arr, zend_array *symbol_tabl
2249
2211
}
2250
2212
if (php_valid_var_name (Z_STRVAL (final_name ), Z_STRLEN (final_name ))) {
2251
2213
if (zend_string_equals_literal (Z_STR (final_name ), "this" )) {
2252
- if (!exception_thrown ) {
2253
- exception_thrown = 1 ;
2254
- zend_throw_error (NULL , "Cannot re-assign $this" );
2255
- }
2214
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2215
+ return -1 ;
2256
2216
} else {
2257
2217
ZVAL_DEREF (entry );
2258
2218
if ((orig_var = zend_hash_find (symbol_table , Z_STR (final_name ))) != NULL ) {
@@ -2278,7 +2238,6 @@ static zend_long php_extract_prefix_all(zend_array *arr, zend_array *symbol_tabl
2278
2238
2279
2239
static zend_long php_extract_ref_prefix_invalid (zend_array * arr , zend_array * symbol_table , zval * prefix ) /* {{{ */
2280
2240
{
2281
- int exception_thrown = 0 ;
2282
2241
zend_long count = 0 ;
2283
2242
zend_string * var_name ;
2284
2243
zend_ulong num_key ;
@@ -2305,10 +2264,8 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym
2305
2264
}
2306
2265
}
2307
2266
if (zend_string_equals_literal (Z_STR (final_name ), "this" )) {
2308
- if (!exception_thrown ) {
2309
- exception_thrown = 1 ;
2310
- zend_throw_error (NULL , "Cannot re-assign $this" );
2311
- }
2267
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2268
+ return -1 ;
2312
2269
} else {
2313
2270
if (Z_ISREF_P (entry )) {
2314
2271
Z_ADDREF_P (entry );
@@ -2335,7 +2292,6 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym
2335
2292
2336
2293
static zend_long php_extract_prefix_invalid (zend_array * arr , zend_array * symbol_table , zval * prefix ) /* {{{ */
2337
2294
{
2338
- int exception_thrown = 0 ;
2339
2295
zend_long count = 0 ;
2340
2296
zend_string * var_name ;
2341
2297
zend_ulong num_key ;
@@ -2362,10 +2318,8 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_
2362
2318
}
2363
2319
}
2364
2320
if (zend_string_equals_literal (Z_STR (final_name ), "this" )) {
2365
- if (!exception_thrown ) {
2366
- exception_thrown = 1 ;
2367
- zend_throw_error (NULL , "Cannot re-assign $this" );
2368
- }
2321
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2322
+ return -1 ;
2369
2323
} else {
2370
2324
ZVAL_DEREF (entry );
2371
2325
if ((orig_var = zend_hash_find (symbol_table , Z_STR (final_name ))) != NULL ) {
@@ -2390,7 +2344,6 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_
2390
2344
2391
2345
static zend_long php_extract_ref_skip (zend_array * arr , zend_array * symbol_table ) /* {{{ */
2392
2346
{
2393
- int exception_thrown = 0 ;
2394
2347
zend_long count = 0 ;
2395
2348
zend_string * var_name ;
2396
2349
zval * entry , * orig_var ;
@@ -2403,11 +2356,8 @@ static zend_long php_extract_ref_skip(zend_array *arr, zend_array *symbol_table)
2403
2356
continue ;
2404
2357
}
2405
2358
if (zend_string_equals_literal (var_name , "this" )) {
2406
- if (!exception_thrown ) {
2407
- exception_thrown = 1 ;
2408
- zend_throw_error (NULL , "Cannot re-assign $this" );
2409
- }
2410
- continue ;
2359
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2360
+ return -1 ;
2411
2361
}
2412
2362
orig_var = zend_hash_find_ex (symbol_table , var_name , 1 );
2413
2363
if (orig_var ) {
@@ -2440,7 +2390,6 @@ static zend_long php_extract_ref_skip(zend_array *arr, zend_array *symbol_table)
2440
2390
2441
2391
static zend_long php_extract_skip (zend_array * arr , zend_array * symbol_table ) /* {{{ */
2442
2392
{
2443
- int exception_thrown = 0 ;
2444
2393
zend_long count = 0 ;
2445
2394
zend_string * var_name ;
2446
2395
zval * entry , * orig_var ;
@@ -2453,11 +2402,8 @@ static zend_long php_extract_skip(zend_array *arr, zend_array *symbol_table) /*
2453
2402
continue ;
2454
2403
}
2455
2404
if (zend_string_equals_literal (var_name , "this" )) {
2456
- if (!exception_thrown ) {
2457
- exception_thrown = 1 ;
2458
- zend_throw_error (NULL , "Cannot re-assign $this" );
2459
- }
2460
- continue ;
2405
+ zend_throw_error (NULL , "Cannot re-assign $this" );
2406
+ return -1 ;
2461
2407
}
2462
2408
orig_var = zend_hash_find_ex (symbol_table , var_name , 1 );
2463
2409
if (orig_var ) {
0 commit comments