Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 'userland' mean in the PHP manual?

Tags:

php

I'm going through the PHP manual and found the word 'userland' a couple of times. What does that usually mean? I found it in this page; I think it's the source code itself but I'm not sure.

From PHP manual:

While executing in a debug environment, configured with --enable-debug, the leak function used in the next example is actually implemented by the engine and is available to call in userland.

like image 235
Lalith Mohan Avatar asked Feb 10 '23 15:02

Lalith Mohan


2 Answers

Since this question does not have a correct answer yet (despite an answer being selected), I'll go ahead and answer this.

The PHP core development team makes three main distinctions when referring to PHP:

  1. PHP core. This refers to the Zend engine that powers PHP. It does things like tokenize userland code, handle memory management, process built-in keywords (if-else, while, isset, etc), and more. That last bit is why built-ins are many times faster than function calls. What PHP core generally does not do is implement functions like substr(), fopen(), etc., which is left to...

  2. PHP extensions. This refers to the majority of the PHP source code but also PECL extensions and other PHP extensions written in C (and sometimes C++). All of the core functions and classes that are always available with PHP are actually implemented in extensions with the biggest extension being 'ext/standard'.

  3. PHP userland. This refers to code that users of PHP generally write that leverage various PHP extensions and the core.

When you see the phrase "pure PHP userland" usually in reference to a PHP userland library that someone writes, they generally mean without dependencies on anything outside of PHP built-ins, extensions that may not be compiled in or available on a host, or external software not in the PHP ecosystem.

The use of any of these phrases may be an indicator that the person tends to lurk on the PHP internals mailing list. Most PHP developers are userland devs and have little to no knowledge of the inner workings of PHP itself.

like image 198
CubicleSoft Avatar answered Feb 12 '23 15:02

CubicleSoft


It's not a PHP term, but a general computing one:

The term userland (or user space) refers to all code which runs outside the operating system's kernel.

https://en.wikipedia.org/wiki/User_space

like image 27
Grim... Avatar answered Feb 12 '23 13:02

Grim...