Change language

PHP Ds / Set reversed () Function

Syntax:
DsSet public DsSet::reversed (void)
Parameter: this function takes no parameters.Return value:this function returns a back copy of the actual instance of Set.The following programs illustrate the Ds / function Set::reversed() :Program 1:  
// Declare an empty set $set = new DsSet ([1, 2, 3, 4, 5]);  
// Print an inverted copy echo ( "Reversed Set is:" ); print_r ( $set -> reversed());  
// The actual set remains unchanged echo "Actual Set is:" ; print_r ( $set );  
?>
Exit:
Reversed Set is : DsSet Object ([0] = > 5 [1] = > 4 [2] = > 3 [3] = > 2 [4] = > 1) Actual Set is: DsSet Object ([0] = > 1 [1] = > 2 [2] = > 3 [3] = > 4 [4] = > 5)
Program 2:  
// Declare an empty set $set = new DsSet ([ "Welcome" , " 2 " , " Geeks " ]);  
// Print an inverted copy echo ( "Reversed Set is:" ); print_r ( $set -> reversed());  
// The actual set remains unchanged echo "Actual Set is:" ; print_r ( $set );  
?>
Exit:
Reversed Set is : DsSet Object ([0] = > Geeks [1] = > 2 [2] = > Welcome) Actual Set is: DsSet Object ([0] = > Welcome [1] = > 2 [2] = > Geeks)
Link: http: // php .net / manual / en / ds-set.reversed.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method