source: src/router/php7/Zend/tests/closure_use_variable_twice.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 2 months ago

update php

File size: 215 bytes
Line 
1--TEST--
2Closure cannot use one variable twice
3--FILE--
4<?php
5
6$a = 1;
7$fn = function() use ($a, &$a) {
8    $a = 2;
9};
10$fn();
11var_dump($a);
12
13?>
14--EXPECTF--
15Fatal error: Cannot use variable $a twice in %s on line %d
Note: See TracBrowser for help on using the repository browser.