Comments (1)
You need to specify that the outer $books variable is global. e.g.
[1] boris> global $books;
[2] boris> $books = ['aaa', 'bbb'];
// array(
// 0 => 'aaa',
// 1 => 'bbb'
// )
[3] boris> function serveBooks() {
[3] *> global $books;
[3] *> var_dump($books);
[3] *> }
[4] boris> serveBooks();
array(2) {
[0]=>
string(3) "aaa"
[1]=>
string(3) "bbb"
}
// NULL
from boris.
Related Issues (20)
- Feature request: add dependencies to the readme HOT 1
- Broken backwards compatibility HOT 11
- Previous and next command with up and down arrow not working HOT 7
- Segmentation Fault HOT 11
- Bug: "use" and "::class" doesn't return the same class. HOT 2
- Undefined variable: boris in .borisrc HOT 1
- CTRL+U incorrect behaviour HOT 4
- Delete key produces tilde HOT 4
- Unicode characters were not accepted HOT 2
- Curly braces used for object property dereferencing cause parse error
- Demo URL is broken in readme file HOT 1
- Packagist no longer has different version based of tags HOT 3
- HTTP Clients may fail silently
- SemVer breakage. HOT 1
- do/while loop doesn't work. HOT 1
- Composer >1.3.0 compatibility
- Support strict types.
- Redefine class/functions
- Demo link returns "Not Found"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boris.