Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is x7f in php?

Tags:

php

What is x7f and xff in php?

Is it hexa or octal values?

EDIT:

It is given in PHP 5.3 manual that, as a regular expression, class name would be expressed as: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*.

can any one help what is the meaning of \x7f-\xff in above regular expression?

like image 896
Poonam Bhatt Avatar asked Mar 14 '11 06:03

Poonam Bhatt


People also ask

What is a PHP function?

Besides the built-in PHP functions, we can create our own functions. A function is a block of statements that can be used repeatedly in a program. A function will not execute immediately when a page loads. A function will be executed by a call to the function.

What is the use of strict declaration in PHP 7?

In PHP 7, type declarations were added. This gives us an option to specify the expected data type when declaring a function, and by adding the strict declaration, it will throw a "Fatal Error" if the data type mismatches. In the following example we try to send both a number and a string to the function without using strict:

How many built-in functions are there in PHP?

PHP has more than 1000 built-in functions, and in addition you can create your own custom functions. PHP has over 1000 built-in functions that can be called directly, from within a script, to perform a specific task. Please check out our PHP reference for a complete overview of the PHP built-in functions.


3 Answers

As per the integer page on PHP.net, the format of hex in PHP is:

hexadecimal : 0[xX][0-9a-fA-F]+

thus it's hex.

like image 175
Mike Lewis Avatar answered Oct 14 '22 00:10

Mike Lewis


As other stated its x7f & xff are hexadecimal code which corresponds to extended ASCII characters that can be added as part of class name in php. ASCII Codes

like image 34
sarathkm Avatar answered Oct 14 '22 00:10

sarathkm


The 0x prefix (not just x) means hexadecimal, so 0x7f is 127 and 0xff is 255.

like image 35
Gabe Avatar answered Oct 13 '22 23:10

Gabe